root package.json not found when specifying different src directory
See original GitHub issueElectron Version: 1.6.5 Electron Packager Version : 8.6.0 Node Version: 6.4.0 NPM Version: 3.10.3
I am using electron-packager with webpack. Essentially building my app with webpack to an output folder called dist and then calling electron-packager. I want to be able to call it like: electron-packager dist but it always fails saying there is no package.json. Obviously there is no package.json in the dist folder but there is an package.json in the root of the project one folder up.
If I copy my package.json from the root into the dist folder and try again it works fine but barring that it will fail. Is there anyway to do this without copying the package.json. Ideally I would like electron-packager to take the root package.json and the code in the dist folder and produce a electron package.
Project Structure
|-root
|-dist
|-app.js
|-index.html
|-node_modules
|-src
|-<source code>
|-webpack.js
|-package.json
electron-packager . - works (but copies everything in root level) electron-package dist - fails
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
The structure you have described can easily be achieved with the current options.
You want to set the “main” value in your package.json file to point at the generated entry point (your DIST folder) then set up the --ignore CLI argument or the ignore option in the API to ignore all files in the original src directory 👍
Got it, thanks.