Electron-packager: Specify path to index.js

Created on 8 Nov 2015  路  4Comments  路  Source: electron/electron-packager

Hi I hope this isn't something I've missed in the documentation but I've been trying for a day and a half now so forgive me if so.

My directory layout is as follows -

DMForge
----app
--------index.js
----assets
----lib
----node_modules
----partials
----.bowerrc
----package.json etc.

package.json scripts -

"start": "electron ./app",
"build": "electron-packager . DMForge --out=dist --ignore='^/dist$' --all --version=0.34.1"

npm start works fine with the electron prebuilt

When I run "npm run build" the generated application looks for my index.js in resourcesappindex.js when it should be in resourcesappappindex.js

image

If I try putting ./app into the electron-packager command I'm missing all of the dependencies that are a level up the tree.

Am I missing a swtich that would let me achieve this build? I know it would probably all work if I threw everything in the one directory but I like the directory layout I'm working with.

My project is at https://github.com/Liam-Ryan/DMForge, at this point it's really nothing more than an alteration of the yeoman generator as a proof of concept.

Thank you for your time

needs info question

Most helpful comment

Isn't this normally solved by specifying the main property in package.json?

All 4 comments

Update - I've moved index.html and index.js to the root of my project and now the packaged app is running fine, I'd like to keep this issue open to see if it's feasible to have an option for the path to the entry point of the electron app

Isn't this normally solved by specifying the main property in package.json?

Sorry I haven't had time to test this, real life interference the last few days. I'll close if it works for me when I get a chance

Tested this.
Setting package.json main prop as entry file solves this problem :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leanderBehr picture leanderBehr  路  3Comments

TracyGJG picture TracyGJG  路  5Comments

wgrhstf picture wgrhstf  路  4Comments

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  路  4Comments

Bharwcb picture Bharwcb  路  5Comments