electron-builder: extraResources get copied to the wrong folder on Linux/Windows
I am trying to build a .deb, and the folder that I specify in extraResources ends up in the wrong place.
Config:
"build": {
"app-bundle-id": "apple.app.id",
"app-category-type": "public.app-category.utilities",
"productName": "Product",
"asar": false,
"extraResources": ["dist/"],
"osx": {
"background": "app/assets/bg.jpg",
"icon": "build/icons/app.icns"
},
"linux": {
}
},
"directories": {
"output": "release"
},
The intermediate packager output looks like
release/
|-Product-linux-x64/
|-...
|-resources/
|-dist/
|-...
When I install and run the .deb I electron gives me file not found errors looking for resources/dist/bundle.js and resources/dist/bundle.css.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (8 by maintainers)
Commits related to this issue
- fix: extra resources copied to wrong folder on linux/windows Closes #379. — committed to GabeIsman/electron-builder by GabeIsman 8 years ago
- docs: add link to #379 and #326 — committed to develar/electron-builder by develar 8 years ago
- docs: add link to #379 and #326 — committed to develar/electron-builder by develar 8 years ago
- docs: add link to #379 and #326 — committed to electron-userland/electron-builder by develar 8 years ago
- docs: add link to #379 and #326 — committed to develar/electron-builder by develar 8 years ago
Hey @develar, thanks for answering!
I’m building my app with webpack so the distinction between ‘application source code’ and ‘built javascript app’ is important, and I got confused about which corresponded to the electron-builder ‘app’ folder (it’s the built javascript app). So basically I was packaging up my source code and then trying to copy in the actual app 😄.
My working setup now looks like this:
ffi.LibraryThis is a project using a similar setup: https://github.com/xwartz/douban.fm. Would be worth, I think, adding a sentence to the documentation for people with related setups.
Fix:
extraResourcesmust copy files into the same dir where electron app located (app.asar).extraResources,extraFilesmust be added to copy files asextraResourcesdoes before with one exception – on OS X into theContents.Will be implemented in the next major release.