Skip to content

V 2.0.0!!!!

Latest
Compare
Choose a tag to compare
@nklayman nklayman released this 09 May 20:50
· 103 commits to master since this release
b62ae7f

This release has been long overdue and this plugin has been in the RC state for way too long, sorry for the delay. Anyways, better late than never, so here it is! If you were running the latest RC previously, there aren't any breaking changes or required migration steps. Thank you to all my supporters who have funded this project and made this release possible ❤️❤️!!

Breaking Changes from v1.x

A few major deps were upgraded:

  • teser-webpack-plugin ^1.1.0 -> ^2.0.0
  • webpack-chain ^5.0.0 -> ^6.0.0
  • execa: ^1.0.0 -> ^4.0.0
  • electron-builder: ^21.2.0 -> 22.2.0

These upgrades may cause breaking changes depending on your specific application.

The internal tests are now run on vue cli v4, and it is recommended that you update your app to vue cli v4 as well.

Fixes and Features

  • Support latest electron versions
  • nodeIntegration is now optional (and disabled by default), #610
  • electron-builder will now work on macos catalina, #617
  • You can now use the proper spectron version, #467
  • Removed fonts duplication in build, #694
  • You can now bundle preload files with webpack (docs), #613
  • New native dep checker, try it out now! (#861)
  • Vue devtools enabled by default on Electron v8/9 (#378)
  • Support package.json without dependencies field (#828)
  • Support electron being listed in dependencies as well as devDependencies (#829)
  • Support nested pages (#786)
  • And a lot more smaller fixes

Migrating a v1.x Project:

  1. Run (yarn add | npm install) -D vue-cli-plugin-electron-builder@latest to install the 2.0 version of the plugin.
  2. In your background.(js|ts), replace nodeIntegration:true with:
// Use pluginOptions.nodeIntegration, leave this alone 
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info 
   nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION 
  1. If your app requires nodeIntegration, enable it in vue.config.js:
module.exports = {
  pluginOptions: {
    electronBuilder: {
      nodeIntegration: true
    }
  }
}
  1. If you used the testWithSpectron function, install the proper version of spectron according to the version map, and pass the spectron import at the first argument of all of your testWithSpectron calls. See the docs for more details.
  2. If you used jest, set the test environment to node in each electron test file. See the docs for more details.
  3. Update your main process file (src/background.js by default) to use electron-devtools-installer:
import {
  createProtocol,
- installVueDevtools
} from 'vue-cli-plugin-electron-builder/lib'
+ import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'

... (around line 77)

-await installVueDevtools()
+await installExtension(VUEJS_DEVTOOLS)

And then run npm i -D electron-devtools-installer/yarn add -D electron-devtools-installer.

After following these steps, your project should be good to go with v2.0!