Skip to content

Commit

Permalink
Merge pull request #4838 from storybooks/core/fix-mangle
Browse files Browse the repository at this point in the history
Core - do not mangle on production build
  • Loading branch information
igor-dv authored Nov 24, 2018
2 parents bb3a431 + a8381d1 commit b287a99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"style-loader": "^0.23.1",
"svg-url-loader": "^2.3.2",
"url-loader": "^1.1.2",
"terser-webpack-plugin": "^1.1.0",
"webpack": "^4.23.1",
"webpack-dev-middleware": "^3.4.0",
"webpack-hot-middleware": "^2.24.3"
Expand Down
11 changes: 11 additions & 0 deletions lib/core/src/server/preview/iframe-webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Dotenv from 'dotenv-webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
import WatchMissingNodeModulesPlugin from 'react-dev-utils/WatchMissingNodeModulesPlugin';
import TerserWebpackPlugin from 'terser-webpack-plugin';

import {
includePaths,
Expand Down Expand Up @@ -95,6 +96,16 @@ export default ({
chunks: 'all',
},
runtimeChunk: true,
minimizer: [
new TerserWebpackPlugin({
cache: true,
parallel: true,
sourceMap: true,
terserOptions: {
mangle: false,
},
}),
],
},
performance: {
hints: isProd ? 'warning' : false,
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21370,7 +21370,7 @@ term-size@^1.2.0:
dependencies:
execa "^0.7.0"

[email protected]:
[email protected], terser-webpack-plugin@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.1.0.tgz#cf7c25a1eee25bf121f4a587bb9e004e3f80e528"
integrity sha512-61lV0DSxMAZ8AyZG7/A4a3UPlrbOBo8NIQ4tJzLPAdGOQ+yoNC7l5ijEow27lBAL2humer01KLS6bGIMYQxKoA==
Expand Down

0 comments on commit b287a99

Please sign in to comment.