Skip to content

Commit

Permalink
Preserve JS function names while minifying
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Aleksandrychiev <ihor.aleksandrychiev@northern.tech>
  • Loading branch information
aleksandrychev committed Jan 3, 2024
1 parent 7a0b41f commit fd5d511
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion generator/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ module.exports = {
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin(), new CssMinimizerPlugin()],
minimizer: [
new TerserPlugin({
terserOptions: {
keep_fnames: true // Preserve function names. Needed to use some functions inside the onclick attr
},
}),
new CssMinimizerPlugin()
],
},
module: {
rules: [
Expand Down

0 comments on commit fd5d511

Please sign in to comment.