一、安装
三、问题
3.1、process is not defined
在webpack.renderer.config.js中添加以下代码
templateParameters(compilation, assets, options) { return { compilation: compilation, webpack: compilation.getStats().toJson(), webpackConfig: compilation.options, htmlWebpackPlugin: { files: assets, options: options }, process } },
3.2、解决Electron Security Warning
在main.js添加以下代码
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
3.3、npm run build有问题,打包不出exe文件
"electron-builder": "^20.19.2", // 我们需要替换成 "electron-builder": "^19.19.1",