Add option to apply applicable options to package.json
See original GitHub issue- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project follows, as appropriate.
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
For instance, setting the app-version
option would not only change the “ProductVersion metadata property on Windows, and CFBundleShortVersionString on OS X”, but would also change version
in the packaged app’s package.json
. This way, accessing app.version
from Electron will return the version passed to electron-packager, and not the original version.
As far as I can tell, this would only apply to the version
and name
options. I think name
should modify productName
in package.json.
IMHO, this should eventually be made the default behavior, but that would require a major version change.
If this sounds good, I might go ahead and work on a PR for this.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Add option to apply applicable options to package.json #602
As far as I can tell, this would only apply to the version and name options. I think name should modify productName in...
Read more >package.json - npm Docs
This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a...
Read more >Add custom metadata or config to package.json, is it valid?
Yes, you're allowed to add custom entries to package.json . Choose a key name: not already defined (details below); not reserved for future...
Read more >How To Use Node.js Modules with npm and package.json
The first step will be to create and understand the package.json file. You will then use it to keep track of all the...
Read more >An Introduction to Package JSON Scripts in Node.js
Lots of Node.js codebases use the package.json file as an ... you can pass options to the command you are using in your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m not inclined to add this functionality to Electron Packager, partly because I don’t see a broader use case for it, and partly because I think it will make the code base messier than it already is.
However, you can implement it for your app by using an afterCopy hook with the packager API:
electron-builder for such use case supports
--extraMetadata
— ability to inject/modify package.json (e.g. https://github.com/electron-userland/electron-builder/issues/639#issuecomment-237545651). Because in general such options should be inferred from package.json, not vice versa.