I have 3 reaction related packages in my .json package, and version numbers need to be synchronized. I know with Maven, you can define variables in a POM file to reuse and keep version numbers in sync across different packages.
I want to do the same with my npm package.json, for example:
...
"config": {
"react_version": "^15.4.1"
},
"dependencies": {
"react": "$npm_package_config_react_version",
"react-addons-test-utils": "$npm_package_config_react_version",
"react-dom": "$npm_package_config_react_version"
}
...
It seems that the variables configset in the package.json file can only be used inside your commands script.
Is there any way to solve this problem at the moment? Will something like this be included in a future version of npm?
source
share