question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build-storybook does not respect webpack.config.js

See original GitHub issue

Describe 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:

  1. Create a basic webpack.config.js, set the following:
optimization: {
  minimize: false,
},
  1. Run start-storybook, go to browser, inspect element
  2. Go to sources, check the files, they are transpiled but not minified
  3. 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
brianzinncommented, Oct 8, 2019

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 optional mode param let’s you know if it’s dev/prod.

0reactions
ndelangencommented, Jan 9, 2020

@brianzinn is correct.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found