-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build-storybook does not respect webpack.config.js #8062
Comments
I have used this and my build output is not minified (5.2.1):
There is a CLI option to verify your your config (from https://storybook.js.org/docs/configurations/cli-options/). ie: I am having trouble currently even with |
Hey Brian, If it is, than it's a Webpack issue I think. |
@ndelangen What I can verify is that with the web.config above that I was able to turn off minimize in prod build on 5.2.1. The other things I mentioned were solved by a custom .babelrc (otherwise imported modules were corrupted). I think this can be closed, but I was hoping @jorenbroekema would reply with his full file to confirm. |
Hey guys thanks for looking into this. I will look into this tomorrow afternoon to see if I can still reproduce this problem with the latest storybook, and if so, post the minimum config I can reproduce it with :). Oh and I'll use |
Alright so I managed to reproduce it with the following config: module.exports = {
optimization: {
minimize: false,
},
module: {
rules: [
{
test: [/\.stories\.js$/, /index\.js$/],
loaders: [require.resolve('@storybook/addon-storysource/loader')],
enforce: 'pre',
},
{
test: new RegExp(
`node_modules(\\/|\\\\)(${['lit-html', 'lit-element', '@open-wc'].join('|')})(.*)\\.js$`,
),
use: {
loader: 'babel-loader',
options: {
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-object-rest-spread',
],
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
corejs: '2',
},
],
],
babelrc: false,
},
},
},
],
},
}; The debugger (--debug-webpack) spits out two things, a
Am I doing something wrong entirely with this optimization: { minimize ... ? I'm using @storybook/polymer btw |
I think that you need to update the |
@brianzinn is correct. |
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:
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 notuglify
orminify
.The text was updated successfully, but these errors were encountered: