I want to change my electron version in package.json file on the basis of the production and development stage. If my project in the development phase then it will take electron 11.2.0 version and in production my electron version must be electron 3.1.1. Is there any way to do this task or apply this condition on my package.json file?
Asked
Active
Viewed 651 times
3
-
1Electron v11.2.0 and v3.1.1 are **drastically** different in terms of API changes. Are you completely sure you want to be hopping around versions like that? – Joshua Mar 26 '21 at 06:38
1 Answers
-1
Yeah.
You can add a devDependencies
object to your package.json. Also when you install packages to your project you can install them with the --save-dev
flag to automatically do that.
It will look like this:
"name": "my_package",
"version": "1.0.0",
"dependencies": {
"my_dep": "^1.0.0",
"another_dep": "~2.2.0"
},
"devDependencies" : {
"my_test_framework": "^3.1.0".
"another_dev_dep": "1.0.0 - 1.2.0"
}
More information can be found in the official documentation for npm.
https://docs.npmjs.com/specifying-dependencies-and-devdependencies-in-a-package-json-file

Travis
- 207
- 1
- 11