mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
build(component): fix component storybook (#9990)
This commit is contained in:
@@ -3,7 +3,6 @@ import { StorybookConfig } from '@storybook/react-vite';
|
||||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
||||
import swc from 'unplugin-swc';
|
||||
import { mergeConfig } from 'vite';
|
||||
import { getBuildConfig } from '@affine-tools/utils/build-config';
|
||||
|
||||
export default {
|
||||
stories: ['../src/ui/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
|
||||
@@ -26,6 +25,9 @@ export default {
|
||||
docs: {},
|
||||
|
||||
async viteFinal(config, _options) {
|
||||
const { getBuildConfig } = await import('@affine-tools/utils/build-config');
|
||||
const { Package } = await import('@affine-tools/utils/workspace');
|
||||
|
||||
return mergeConfig(config, {
|
||||
plugins: [
|
||||
vanillaExtractPlugin(),
|
||||
@@ -55,12 +57,9 @@ export default {
|
||||
define: {
|
||||
'process.env.CAPTCHA_SITE_KEY': `"${process.env.CAPTCHA_SITE_KEY}"`,
|
||||
...Object.entries(
|
||||
getBuildConfig({
|
||||
distribution: 'web',
|
||||
getBuildConfig(new Package('@affine/web'), {
|
||||
mode: 'development',
|
||||
channel: 'canary',
|
||||
static: false,
|
||||
coverage: false,
|
||||
})
|
||||
).reduce((envs, [key, value]) => {
|
||||
envs[`BUILD_CONFIG.${key}`] = JSON.stringify(value);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "@affine/component",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
@@ -64,6 +65,7 @@
|
||||
"zod": "^3.24.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@affine-tools/utils": "workspace:*",
|
||||
"@blocksuite/affine": "workspace:*",
|
||||
"@blocksuite/icons": "2.2.2",
|
||||
"@chromatic-com/storybook": "^3.2.2",
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
{ "path": "../electron-api" },
|
||||
{ "path": "../graphql" },
|
||||
{ "path": "../i18n" },
|
||||
{ "path": "../../../tools/utils" },
|
||||
{ "path": "../../../blocksuite/affine/all" }
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user