Skip to content

Commit

Permalink
docs(electron): update the way QUASAR_NODE_INTEGRATION should be used q…
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Jul 5, 2020
1 parent 9220cf7 commit d2fb852
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Expand Up @@ -24,7 +24,8 @@ function createWindow () {
mainWindow = new BrowserWindow({
// ...
webPreferences: {
nodeIntegration: QUASAR_NODE_INTEGRATION,
nodeIntegration: process.env.QUASAR_NODE_INTEGRATION,
nodeIntegrationInWorker: process.env.QUASAR_NODE_INTEGRATION,

// HERE IS THE MAGIC:
preload: path.resolve(__dirname, 'electron-preload.js')
Expand Down
Expand Up @@ -43,10 +43,24 @@ electron: {
```

::: tip
Starting with "@quasar/app" v1.7+ you can edit your main thread file to set `nodeIntegration: QUASAR_NODE_INTEGRATION`. The `QUASAR_NODE_INTEGRATION` is a macro injected by Quasar so that you'll have only one place to edit your Node Integration state: quasar.conf.js.
Starting with "@quasar/app" v2.0+ you can edit your main thread file to set `nodeIntegration: process.env.QUASAR_NODE_INTEGRATION`. The `QUASAR_NODE_INTEGRATION` env variable is injected by Quasar so that you'll have only one place to edit your Node Integration state: quasar.conf.js.
:::

### Legacy warning
### Legacy warnings

**If your version of "@quasar/app" is greater than v1.7 and lower than v2.0**, then you also need to use `QUASAR_NODE_INTEGRATION` in your main thread file (/src-electron/main-process/main.js):

```js
// file: /src-electron/main-process/main.js

mainWindow = new BrowserWindow({
// ..

webPreferences: {
nodeIntegration: QUASAR_NODE_INTEGRATION
}
})
```

**If your version of "@quasar/app" is lower than v1.7**, then you also need to edit your main thread file (/src-electron/main-process/main.js):

Expand Down

0 comments on commit d2fb852

Please sign in to comment.