Confused by 2 package.json structure
See original GitHub issue- Version: 5.12.1
- Target: win32
I guess I’m confused by the two-package.json structure.
I am use to installing things with npm, which means everything is specified in /package.json (what you call the development package.json). But electron-builder
gives me errors or deprecation messages for having fields like “homepage” and “license” in my /package.json. However, /app/package.json (what you call the application package.json) is not allowed to have “build” and other fields, so neither file feels “complete”.
- I definitely have to put my app’s dependencies in /app/package.json, but do I need to put them in /package.json too? Or is /package.json just used for build tool dependencies?
- Which would you put on
npm
?
If I make /package.json the npm module, then the dependencies listed would be build dependencies rather than app dependencies, and electron-builder is going to fuss about homepage and license fields. But if I make /app/package.json the npm module, then it will not install the build dependencies, and the npm module will be a folder inside my github repo rather than the github repo.
- Why can’t you just have an “electronDependencies” section in /package.json, and then derive /app/package.json during the build?
Having two keep two separate package.json’s in sync (particularly the “version” field, but also “description”, “homepage” etc) is just inviting me to screw up. I’d much prefer a single source of truth.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
@akashnimare Please file new issue and describe why it doesn’t work for you.
https://github.com/electron-userland/electron-builder/tree/master/test/fixtures/test-app-one
@akashnimare also my project is a real example: https://github.com/wmhilton/ransomAware?files=1