I'm working on an electron application. I've added the dotenv-webpack
plugin in webpack config, but when I try to build it, I receive an error from Terser. Furthermore, if I comment on the TerserPlugin config, the error still appears.
Error from Terser Invalid assignment.
import TerserPlugin from 'terser-webpack-plugin';
import Dotenv from 'dotenv-webpack';
export default {
// ...
optimization: {
minimizer: [
new TerserPlugin({
parallel: true,
}),
],
},
plugins: [
// ...
new Dotenv({
path: path.join(__dirname, '../../.env'), // The path is correct
systemvars: true,
}),
]
}