所以我试图运行 webpack 来编译我的代码,但是当我运行时npx webpack --config webpack.config.js
出现以下错误:
ERROR in main.js from Terser
Invalid assignment [main.js:78674,15]
没有什么可去的,我什至不知道去哪里找。有谁知道可能是什么原因造成的?
这是我的 webpack 配置:
const path = require('path');
module.exports = {
entry: './server.js',
target: "node",
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
publicPath: "/public/"
},
module:{
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-syntax-dynamic-import']
}
}
}
]
},
resolve: {
alias: {
'express-handlebars': 'handlebars/dist/handlebars.js'
}
}
};
谢谢!