preload中使用__dirname报错如下: 在preload文件夹下的index.js中为了测试写了‘console.log('打印');’正确引入后的结果如下 解决方式: 这样就解决了报错问题啦!