Prevent webpack generate `.LICENSE` file when minify (#6737)

* check build result

* list dist file

* Update build script

* restore ci script [skip ci]
master
fisker Cheung 2019-10-30 20:33:52 +08:00 committed by Georgii Dolzhykov
parent f0ddd0e5b6
commit b5a201b0ae
3 changed files with 9 additions and 9 deletions

View File

@ -99,7 +99,7 @@ async function run(params) {
await execa("rm", ["-rf", ".cache"]); await execa("rm", ["-rf", ".cache"]);
} }
const bundleCache = new Cache(".cache/", "v17"); const bundleCache = new Cache(".cache/", "v18");
await bundleCache.load(); await bundleCache.load();
console.log(chalk.inverse(" Building packages ")); console.log(chalk.inverse(" Building packages "));

View File

@ -186,11 +186,7 @@ function getWebpackConfig(bundle) {
const TerserPlugin = require("terser-webpack-plugin"); const TerserPlugin = require("terser-webpack-plugin");
config.optimization = { config.optimization = {
minimizer: [ minimizer: [new TerserPlugin(bundle.terserOptions)]
new TerserPlugin({
terserOptions: bundle.terserOptions
})
]
}; };
} }

View File

@ -73,10 +73,14 @@ const parsers = [
target: "universal", target: "universal",
// postcss has dependency cycles that don't work with rollup // postcss has dependency cycles that don't work with rollup
bundler: "webpack", bundler: "webpack",
// postcss need keep_fnames when minify
terserOptions: { terserOptions: {
mangle: { // prevent terser generate extra .LICENSE file
keep_fnames: true extractComments: false,
terserOptions: {
mangle: {
// postcss need keep_fnames when minify
keep_fnames: true
}
} }
} }
}, },