Merge pull request #4838 from storybooks/core/fix-mangle

Core - do not mangle on production build
This commit is contained in:
Igor 2018-11-24 19:40:08 +02:00 committed by GitHub
commit b287a99fad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -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"

View File

@ -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,
@ -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,

View File

@ -21370,7 +21370,7 @@ term-size@^1.2.0:
dependencies:
execa "^0.7.0"
terser-webpack-plugin@1.1.0:
terser-webpack-plugin@1.1.0, 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==