hedgedoc/webpack.prod.js
David Mehren 41c86d1cf1
Use esbuild to minify frontend JS
This speeds up build times massively

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-06 21:13:56 +02:00

31 lines
784 B
JavaScript

const common = require('./webpack.common.js')
const htmlexport = require('./webpack.htmlexport')
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, {
mode: 'production',
output: {
path: path.join(__dirname, 'public/build'),
publicPath: 'build/',
filename: '[name].[contenthash].js'
},
optimization: {
minimizer: [
new ESBuildMinifyPlugin({
target: 'es2015'
})
]
}
}),
merge(htmlexport, {
mode: 'production',
optimization: {
minimizer: [
new OptimizeCSSAssetsPlugin({})
]
}
})]