mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(core): storybook build issue (#6274)
1. es2022 is required and should be set separately in storybook. 2. @blocksuite/icons versions are not consistent across packages.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { runCli } from '@magic-works/i18n-codegen';
|
||||
import type { StorybookConfig } from '@storybook/react-vite';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { mergeConfig } from 'vite';
|
||||
import { mergeConfig, type InlineConfig } from 'vite';
|
||||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
||||
import { getRuntimeConfig } from '@affine/cli/src/webpack/runtime-config';
|
||||
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
});
|
||||
// disable for storybook build
|
||||
runtimeConfig.enableCloud = false;
|
||||
return mergeConfig(config, {
|
||||
return mergeConfig<InlineConfig, InlineConfig>(config, {
|
||||
assetsInclude: ['**/*.md'],
|
||||
resolve: {
|
||||
alias: {
|
||||
@@ -51,6 +51,9 @@ export default {
|
||||
),
|
||||
},
|
||||
},
|
||||
esbuild: {
|
||||
target: 'ES2022',
|
||||
},
|
||||
plugins: [vanillaExtractPlugin()],
|
||||
define: {
|
||||
'process.on': 'undefined',
|
||||
|
||||
2
tests/storybook/.storybook/polyfill.ts
Normal file
2
tests/storybook/.storybook/polyfill.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
import 'core-js/modules/esnext.symbol.async-dispose';
|
||||
import 'core-js/modules/esnext.symbol.dispose';
|
||||
@@ -1,3 +1,4 @@
|
||||
import './polyfill';
|
||||
import '@affine/component/theme/global.css';
|
||||
import '@affine/component/theme/theme.css';
|
||||
import { createI18n } from '@affine/i18n';
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"@blocksuite/block-std": "0.13.0-canary-202403140735-2367cd5",
|
||||
"@blocksuite/blocks": "0.13.0-canary-202403140735-2367cd5",
|
||||
"@blocksuite/global": "0.13.0-canary-202403140735-2367cd5",
|
||||
"@blocksuite/icons": "2.1.45",
|
||||
"@blocksuite/icons": "2.1.46",
|
||||
"@blocksuite/inline": "0.13.0-canary-202403140735-2367cd5",
|
||||
"@blocksuite/lit": "0.13.0-canary-202403140735-2367cd5",
|
||||
"@blocksuite/presets": "0.13.0-canary-202403140735-2367cd5",
|
||||
|
||||
Reference in New Issue
Block a user