Vue-cli-plugin-electron-builder: vue.config.js asarUnpack doesn't work

Created on 15 Jul 2019  路  4Comments  路  Source: nklayman/vue-cli-plugin-electron-builder

Describe the bug
I have a plug-in folder. I want to pack it and put it in the app. asar. unpacked folder.I set the following in vue. config.js. When I build it and found it doesn't work.

module.exports = { pluginOptions: { electronBuilder: { builderOptions: { "appId": "xx", "productName": "xx", "copyright":"xx", "win": { "icon": "res/logo.ico" }, "publish": [ { "provider": "generic", "url": "http://xxx/version/", } ], "asar":true, "asarUnpack":[ "plugins" ] } } }, pages: { index: 'src/main.js', main: 'src/views/Main/main.js', setting: 'src/views/Setting/main.js', } }

To Reproduce
Steps to reproduce the behavior:

Expected behavior
I want build it and lets plug-in files be placed in the app.asar.unpacked folder.

Screenshots
image

Environment (please complete the following information):

  • OS and version: windows10
  • node version: 10.15.3
  • npm version: 6.4.1
  • yarn version (if used):
  • vue-cli-plugin-electron-builder version : latest
  • electron version: 5.0.6
  • other vue plugins used: vuetify, vue-router, vuex, vuetify-loader, vue-template-compiler
  • custom config for vcp-electron-builder: none
  • (if possible) link to your repo:

Additional context
Add any other context about the problem here.

Most helpful comment

Thanks, I have solved it in the following ways:
"extraFiles":{
"from":"plugins",
"to":"./resources/app.asar.unpacked/plugins/"
}

All 4 comments

From the electron builder documentation:

If you need to use some files, e.g. as tray icon, please include required files explicitly: "files": ["*/", "build/icon.*"]

Folders in your project won't be included in the built app unless listed here. List you plugins folder here as well, and it should work.

Thanks, I have solved it in the following ways:
"extraFiles":{
"from":"plugins",
"to":"./resources/app.asar.unpacked/plugins/"
}

Closing as you found a solution.

Thanks, I have solved it in the following ways:
"extraFiles":{
"from":"plugins",
"to":"./resources/app.asar.unpacked/plugins/"
}
@HarlanGitHub

Your answer saved my day thanks!

Was this page helpful?
0 / 5 - 0 ratings