Prevent webpack generate `.LICENSE` file when minify (#6737)
* check build result * list dist file * Update build script * restore ci script [skip ci]master
parent
f0ddd0e5b6
commit
b5a201b0ae
|
@ -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 "));
|
||||||
|
|
|
@ -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
|
|
||||||
})
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue