electron 版本为 v.16.0.2 引入 fs时报错 require is not defined
解决方案为
下面展示一些 内联代码片
。
mainWindow = new BrowserWindow({
width:800,
height:800,
webPreferences: {
nodeIntegration: true, // 只设置它为true 没用
contextIsolation:false // 必须要加上这段
}
})
mainWindow = new BrowserWindow({
width:800,
height:800,
webPreferences: {
nodeIntegration: true, // 只设置它为true 没用
contextIsolation:false // 必须要加上这段
}
})