2018-10-10 15:54:27 -04:00
|
|
|
const common = require('./webpack.common.js')
|
|
|
|
const htmlexport = require('./webpack.htmlexport')
|
2021-05-05 07:37:47 -04:00
|
|
|
const { merge } = require('webpack-merge')
|
2018-10-10 15:54:27 -04:00
|
|
|
const path = require('path')
|
2018-07-03 16:47:50 -04:00
|
|
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
|
2023-02-12 15:03:24 -05:00
|
|
|
const { EsbuildPlugin } = require('esbuild-loader')
|
2016-10-11 03:45:00 -04:00
|
|
|
|
2018-10-10 15:54:27 -04:00
|
|
|
module.exports = [
|
|
|
|
merge(common, {
|
|
|
|
mode: 'production',
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'public/build'),
|
2019-12-19 12:00:51 -05:00
|
|
|
publicPath: 'build/',
|
2018-10-10 15:54:27 -04:00
|
|
|
filename: '[name].[contenthash].js'
|
2021-05-05 07:37:47 -04:00
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
minimizer: [
|
2023-02-12 15:03:24 -05:00
|
|
|
new EsbuildPlugin({
|
2021-08-14 10:18:23 -04:00
|
|
|
target: 'es2015',
|
2023-02-17 12:02:35 -05:00
|
|
|
format: "cjs",
|
2021-08-14 10:18:23 -04:00
|
|
|
exclude: ['MathJax/extensions/a11y/mathmaps']
|
2021-05-05 07:37:47 -04:00
|
|
|
})
|
2021-06-06 16:23:55 -04:00
|
|
|
],
|
|
|
|
splitChunks: {
|
|
|
|
chunks: 'all'
|
|
|
|
}
|
2021-06-06 16:24:22 -04:00
|
|
|
},
|
|
|
|
devtool: 'source-map'
|
2018-10-10 15:54:27 -04:00
|
|
|
}),
|
|
|
|
merge(htmlexport, {
|
|
|
|
mode: 'production',
|
|
|
|
optimization: {
|
|
|
|
minimizer: [
|
2023-02-12 15:03:24 -05:00
|
|
|
new EsbuildPlugin({
|
2023-02-17 12:02:35 -05:00
|
|
|
target: 'es2015',
|
|
|
|
format: "cjs"
|
2021-06-21 14:14:29 -04:00
|
|
|
}),
|
2018-10-10 15:54:27 -04:00
|
|
|
new OptimizeCSSAssetsPlugin({})
|
2018-07-02 16:24:56 -04:00
|
|
|
]
|
2018-10-10 15:54:27 -04:00
|
|
|
}
|
|
|
|
})]
|