summaryrefslogtreecommitdiff
path: root/webpack.prod.js
diff options
context:
space:
mode:
authorDavid Mehren2021-05-05 13:37:47 +0200
committerDavid Mehren2021-05-06 21:13:56 +0200
commit41c86d1cf111b20c130688ef26a418a92b978f64 (patch)
treec896e600f1862340daf06f8e497d5192c6560d27 /webpack.prod.js
parentad7fadee17889b904b2a62facd0cef86b71271ab (diff)
Use esbuild to minify frontend JS
This speeds up build times massively Signed-off-by: David Mehren <git@herrmehren.de>
Diffstat (limited to 'webpack.prod.js')
-rw-r--r--webpack.prod.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/webpack.prod.js b/webpack.prod.js
index 5c523c06..92ee1578 100644
--- a/webpack.prod.js
+++ b/webpack.prod.js
@@ -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, {