Skip to content

Commit

Permalink
Merge pull request #206 from iCHEF/bugfix/yarn-start-not-work-due-to-…
Browse files Browse the repository at this point in the history
…minimizer

[Storybook] Fix yarn start not work due to adding minimizer in dev env #trivial
  • Loading branch information
chenesan authored Apr 24, 2019
2 parents 7df996a + ff88daf commit c5f47e9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/storybook/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ module.exports = (baseConfig, env, defaultConfig) => {
// Following config customize the TerserPlugin to remove the mangling.
// Note that this will make the total bundle size increase a little (2.9MB => 3.2MB).
// Consider storybook is for developer this should be fine.
// eslint-disable-next-line no-param-reassign
defaultConfig.optimization.minimizer = [new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
mangle: false,
}
})];
if (defaultConfig.optimization && env === 'PRODUCTION') {
// eslint-disable-next-line no-param-reassign
defaultConfig.optimization.minimizer = [new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
mangle: false,
}
})];
}

// Ref: Storybook webpack dev config https://git.io/fpJ6h
const babelLoaderRule = defaultConfig.module.rules[0];
Expand Down

0 comments on commit c5f47e9

Please sign in to comment.