[STORYBOOK] storyStoreV7, Webpack5 lazyCompilation and fsCache options don't work
See original GitHub issueCurrent Behavior
When i configure storybook webpack 5 with code splitting, lazy compilation and filesystem caching, storybook start without considering no one of that configuraton options:
// .storybook/main.js
module.exports = {
features: {
storyStoreV7: true
},
core: {
builder: {
name: 'webpack5',
options: {
lazyCompilation: true,
fsCache: true,
},
},
},
};
Expected Behavior
When I set storyStoreV7: true, lazyCompilation: true and fsCache: true, storybook start with code splitting, lazy Compilation and file system cache.
Steps to Reproduce
Set storybook main file as below
// .storybook/main.js
module.exports = {
features: {
storyStoreV7: true
},
core: {
builder: {
name: 'webpack5',
options: {
lazyCompilation: true,
fsCache: true,
},
},
},
};
Official storybook doc: https://storybook.js.org/docs/react/builders/webpack
Failure Logs
None! Storybook start without considering the provided webpack 5 configuration described above.
Environment
Nx v14.6.1 Storybook 6.5.4
Issue Analytics
- State:
- Created a year ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Storybook Lazy Compilation for Webpack - JS.ORG
Webpack 5 introduced the persistent file system caching feature, allowing it to use information from previous builds to skip unnecessary steps.
Read more >Import scss file is not working inside storybook file
If I use css file, the style will be working. I'm already following the instruction from documentation on using @storybook/preset-scss and the webpackFinal...
Read more >@storybook/preset-vue-webpack: Versions | Openbase
Full version history for @storybook/preset-vue-webpack including change logs. ... from storybook scripts #19366; Webpack5: Fix lazy compilation/fscache ...
Read more >Source - GitHub
webpackHot instead of module.hot for check ... Webpack5: Fix lazy compilation/fscache builderOptions when base config is disabled ...
Read more >Storybook Lazy Compilation for Webpack : r/reactjs - Reddit
As your Storybook grows, it takes longer to start and rebuild. More stories mean more work to process and bundle up your code....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey @mandarini I found what is missing for
lazyCompilationandfsCacheto work 🎉How Storybook work?
Setting the following builder …
… the base webpack configuration should be composed with the following options as a fresh install of Storybook without Nx
What needs to do Nx side?
Considering
lazyCompilationandfsCachebuilder options as did by Storybook here: https://github.com/storybookjs/storybook/blob/7035ea7389393da041985ebc491ee58dedb50d06/code/lib/builder-webpack5/src/preview/base-webpack.config.ts#L53-L55My final configuration for maximizing the performance (SWC + lazyCompilation + devtool = false)
Repro: https://github.com/ild0tt0re/storybook-import-type/tree/storybook-lazy-compilation
I got the same error in the provided repro above.
Changes based on your feature branch: https://github.com/mandarini/storybook-import-type/pull/1/files
To test it you can run
yarn installandMy Nx report: