Skip to content

Commit

Permalink
fix: terser workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleyrs committed Jul 28, 2024
1 parent 22c7238 commit 3cb2520
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const webpack = require('webpack');
const path = require('path');
const fs = require('fs');

const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

const isProduction = process.env.NODE_ENV === 'production';
const isWebWorker = fs.existsSync('src/public/worker.js') || fs.existsSync('src/public/LoginThread.js')
const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader';

const pages = [
Expand Down Expand Up @@ -124,10 +126,8 @@ module.exports = () => {
minify: TerserPlugin.terserMinify,
parallel: true,
terserOptions: {
module: true,
mangle: true,
/*
mangle: {
module: isWebWorker,
mangle: isWebWorker ? true : {
properties: {
keep_quoted: true, // needed for tinymidipcm.mjs
reserved: [
Expand Down Expand Up @@ -402,7 +402,6 @@ module.exports = () => {
quote_style: 3, // original
keep_quoted_props: true // needed for tinymidipcm.mjs
}
*/
}
})
);
Expand Down

0 comments on commit 3cb2520

Please sign in to comment.