build-storybook does not respect webpack.config.js
See original GitHub issueDescribe the bug I turned off minification in my webpack.config.js, which works for start-storybook. For build-storybook however, this override is not respected.
To Reproduce Steps to reproduce the behavior:
- Create a basic webpack.config.js, set the following:
optimization: {
minimize: false,
},
- Run start-storybook, go to browser, inspect element
- Go to sources, check the files, they are transpiled but not minified
- Run build-storybook, go into the storybook-static folder, open index.html, check sources, they are minified 😦
Expected behavior Non-minified output files after running build-storybook
On a sidenote I am a bit confused why the option is called minimize
and not uglify
or minify
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Webpack - Storybook
Storybook displays your components in a custom web application built using Webpack. Webpack is a complex tool, but our default configuration is intended...
Read more >Storybook ERROR. Module not found: Error: Can't resolve ...
I tried to apply Storybook to a React Project (NO-CRA) but Storybook can't resolve webpack.config.js and webpack.shared.js "alias" settings, ...
Read more >@storybook/builder-webpack5 | Yarn - Package Manager
Builder implemented with webpack5 and webpack5 -compatible loaders/plugins/config, used by @storybook/core-server to build the preview iframe. webpack4 is the ...
Read more >Building storybook - RedwoodJS Community
ts config/preview.ts cp config/storybook.config.js config/main.js yarn build-storybook -c config mv config/webpack.config.js_ config ...
Read more >@storybook/client-api: Versions | Openbase
Build-storybook : Only copy .mjs files for manager build #19647; Rename storybook/ui to ... Vite: Do not add Webpack loaders when using Vite...
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
I think that you need to update the
config
that is passed in. So, your first line should be:module.exports = async ({ config, mode }) => {
. and then you can update the config object (ie:config.optimization = ...
). The optionalmode
param let’s you know if it’s dev/prod.@brianzinn is correct.