Browse Source

chore: esbuild target (#26357)

* chore: esbuild target

* Update bisheng.config.js

* fix lint

Co-authored-by: 二货机器人 <smith3816@gmail.com>
pull/26375/head
信鑫-King 4 years ago
committed by GitHub
parent
commit
9b6db94fdf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      site/bisheng.config.js
  2. 4
      webpack.config.js

7
site/bisheng.config.js

@ -90,7 +90,12 @@ module.exports = {
config.resolve.alias = { ...config.resolve.alias, react: require.resolve('react') };
} else if (process.env.ESBUILD) {
// use esbuild
config.optimization.minimizer = [new EsbuildPlugin(), new CssMinimizerPlugin()];
config.optimization.minimizer = [
new EsbuildPlugin({
target: 'chrome49',
}),
new CssMinimizerPlugin(),
];
}
alertBabelConfig(config.module.rules);

4
webpack.config.js

@ -99,7 +99,9 @@ if (process.env.RUN_ENV === 'PRODUCTION') {
config.optimization.usedExports = true;
// use esbuild
if (process.env.ESBUILD || process.env.CSB_REPO) {
config.optimization.minimizer[0] = new EsbuildPlugin();
config.optimization.minimizer[0] = new EsbuildPlugin({
target: 'chrome49',
});
}
config.plugins.push(

Loading…
Cancel
Save