electron-vue使用高版本nodejs出现Referen
2020-06-11 本文已影响0人
期丨期
electron-vue使用高版本nodejs出现ReferenceError: process is not define
修改.electron-vue/webpack.renderer.config.js
文件
new HtmlWebpackPlugin({
filename: 'index.html',
template: path.resolve(__dirname, '../src/index.ejs'),
templateParameters(compilation, assets, options) {
return {
compilation: compilation,
webpack: compilation.getStats().toJson(),
webpackConfig: compilation.options,
htmlWebpackPlugin: {
files: assets,
options: options
},
process,
};
},
minify: {
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true
},
nodeModules: false
}),