错误如下
Html Webpack Plugin:
ReferenceError: process is not defined
- index.ejs:11 eval
[.]/[html-webpack-plugin]/lib/loader.js!./src/index.ejs:11:2
- index.ejs:16 module.exports
[.]/[html-webpack-plugin]/lib/loader.js!./src/index.ejs:16:3
- index.js:284
[test]/[html-webpack-plugin]/index.js:284:18
- task_queues.js:97 processTicksAndRejections
internal/process/task_queues.js:97:5
正确解决
找到./src/index.ejs
<% if (!process.browser) { %>
更改为
<% if (!require('process').browser) { %>
再次运行 npm run dev
即可成功启动
参考:https://github.com/SimulatedGREG/electron-vue/issues/871