-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modify configs and improve build chunking
- Loading branch information
1 parent
c0e9f2a
commit bea2a57
Showing
6 changed files
with
496 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
node_modules | ||
dist | ||
/Icon? | ||
/graphics | ||
|
||
/storybook-static | ||
/graphics | ||
/.storybook-dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ node_modules/ | |
package-lock.json | ||
|
||
graphics/ | ||
storybook-static/ | ||
.storybook-dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,37 @@ | ||
import {StorybookConfig} from '@storybook/core-common'; | ||
|
||
const storybookConfig: StorybookConfig = { | ||
stories: [ | ||
'../src/**/*.stories.mdx', | ||
'../src/**/*.stories.@(js|jsx|ts|tsx)', | ||
], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions', | ||
], | ||
framework: '@storybook/react', | ||
export const stories: StorybookConfig['stories'] = [ | ||
'../src/**/*.stories.mdx', | ||
'../src/**/*.stories.@(js|jsx|ts|tsx)', | ||
]; | ||
export const addons: StorybookConfig['addons'] = [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions', | ||
]; | ||
export const framework: StorybookConfig['framework'] = '@storybook/react'; | ||
|
||
const maxAssetSize = 1024 * 1024; | ||
|
||
export const webpackFinal: StorybookConfig['webpackFinal'] = (config) => { | ||
config.optimization = { | ||
...config.optimization, | ||
splitChunks: { | ||
...config.optimization?.splitChunks, | ||
chunks: 'all', | ||
minSize: 30 * 1024, | ||
maxSize: maxAssetSize, | ||
}, | ||
}; | ||
config.performance = { | ||
...config.performance, | ||
maxAssetSize: maxAssetSize, | ||
}; | ||
|
||
return config; | ||
}; | ||
|
||
export default storybookConfig; | ||
export const features: StorybookConfig['features'] = { | ||
/** Decrease bundle size */ | ||
storyStoreV7: true, | ||
}; |
Oops, something went wrong.