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"]);
}
const bundleCache = new Cache(".cache/", "v17");
const bundleCache = new Cache(".cache/", "v18");
await bundleCache.load();
console.log(chalk.inverse(" Building packages "));

View File

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

View File

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