Use esbuild to minify frontend JS
This speeds up build times massively Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
const common = require('./webpack.common.js')
|
||||
const htmlexport = require('./webpack.htmlexport')
|
||||
const { merge } = require('webpack-merge');
|
||||
const { merge } = require('webpack-merge')
|
||||
const path = require('path')
|
||||
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const { ESBuildMinifyPlugin } = require('esbuild-loader')
|
||||
|
||||
module.exports = [
|
||||
merge(common, {
|
||||
@@ -11,6 +12,13 @@ module.exports = [
|
||||
path: path.join(__dirname, 'public/build'),
|
||||
publicPath: 'build/',
|
||||
filename: '[name].[contenthash].js'
|
||||
},
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new ESBuildMinifyPlugin({
|
||||
target: 'es2015'
|
||||
})
|
||||
]
|
||||
}
|
||||
}),
|
||||
merge(htmlexport, {
|
||||
|
||||
Reference in New Issue
Block a user