当前位置:网站首页>Step on the electric render process renderer to solve the problem of require is not defined

Step on the electric render process renderer to solve the problem of require is not defined

2022-07-23 13:02:00 All the way

Step on the pit electron Rendering Progress renderer, solve require is not defined The problem of

 Insert picture description here
terms of settlement

nodeIntegration: true

If it can't be solved, plus

contextIsolation: false

Complete code

function createWindow () {
    
  const win = new BrowserWindow({
    
    width: 800,
    height: 600,
    frame: false,
    webPreferences: {
    
      preload: path.join(__dirname, 'preload.js'),
      nodeIntegration: true,
      contextIsolation: false
    }
  })

  win.loadFile('index.html')
}
原网站

版权声明
本文为[All the way]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207230540445389.html