Skip to content

preload.js如何设置呢? #6

@woestler

Description

@woestler

preload.js如何设置呢?

webPreferences: {
      nodeIntegration: true,
      contextIsolation: true,
      devTools: process.env.NODE_ENV !== "production",
      preload: path.join(rootPath, "src/main/preload.js"),
},

在设置contextIsolation为true之后会报错
报错信息如下:

Uncaught ReferenceError: global is not defined
    at jsonp chunk loading:42:1
    at jsonp chunk loading:511:1
    at startup:6:1

求解决,谢谢

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions