Storybook: How to disable minification when running `build-storybook`?

Created on 5 May 2016  路  13Comments  路  Source: storybookjs/storybook

Is there a way not to minify the JS files when running build-storybook?

Most helpful comment

@arunoda sorry to reopen such an old thread but the docs aren't clear on what you need to do to set configType to DEVELOPMENT

Can you show an example of how one might set that variable and return it with the config?

All 13 comments

Currently there is no way. You need to change the webpack config and remove uglifyjs plugin.
You can try this: #160

@arunoda Isn't #60 allows extending only _webpack.config.js_ but not _webpack.config.prod.js_?

Okay. It's the production build. So, we need to support the production build too.
@mnmtanish could you find some way to add production webpack conf support to #160 as well.

@moroshko @arunoda both use the config.js file to build the config so it should work out of the box. I'll check it out.

@mnmtanish As far as I can see, custom config is hardcoded to webpack.config.js, so we never check if a custom webpack.config.prod.js exists.

@moroshko I checked the code, yes it'll work for both alike.

@moroshko I also though at first that having 2 files will be easy and straightforward but it can cause some issues.

So far we're using custom config from webpack.config.js for both the dev-server and the production builds. If we use separate files, users who need the same custom config for both will have to make a copy of the file. Let's say we try to fix it by falling back to webpack.config.js if webpack.config.prod.js does not exist, it makes the config more ambiguous and some users may not want that to happen.

We can fix this for now by adding a configType argument to the config function. I've opened a pull request for this https://github.com/kadirahq/react-storybook/pull/169

@mnmtanish Thanks for #169. I'd just update the docs to reflect the changes.

@moroshko Where did you update the docs?

@arunoda I didn't. I suggested @mnmtanish to update the docs as part of #169.

@moroshko Ah okay. BTW: I did it.

Thanks @arunoda

@arunoda sorry to reopen such an old thread but the docs aren't clear on what you need to do to set configType to DEVELOPMENT

Can you show an example of how one might set that variable and return it with the config?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tlrobinson picture tlrobinson  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments

arunoda picture arunoda  路  3Comments

oriSomething picture oriSomething  路  3Comments

rpersaud picture rpersaud  路  3Comments