Is there an equivalent in yarn to: npm_package_config ?
For instance if I wanted to access the config object below using npm, I could access it with: $npm_package_config_base
package.json:
{
"config": {
"base": "/home/"
}
}
We'll be working on workspaces feature that will address multi folder projects
@bestander: This doesn't necessarily have anything to do with multi-folder projects. npm_package_config is generic mechanism for defining variables in the package.json and then referencing them in scripts in a way that users can control using npm config. From the docs:
A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. For instance, if a package had the following:
{ "name" : "foo", "config" : { "port" : "8080" } }and then had a "start" command that then referenced the
npm_package_config_portenvironment variable, then the user could override that by doingnpm config set foo:port 8001.
@wincent, you are right, we should support it.
@bestander, This feature is so important to migrate from npm to yarn. But yarn doesnt support it still? Can you tell in which yarn version will it available?
@shankarshastri, this is a community project and this feature will be available right after you submit a PR for this feature.
This should be fixed in recent versions of Yarn. Please reopen if it is missing anything.
@BYK and @shankarshastri I'd like to re-open this as I don't think this is fixed.
Willing to contribute to this, but wanted to do a sanity check with you first to make sure I'm not misunderstanding something.
https://github.com/cantide5ga/yarn-npm_package_config-support demonstrates the bug.
Most helpful comment
@BYK and @shankarshastri I'd like to re-open this as I don't think this is fixed.
Willing to contribute to this, but wanted to do a sanity check with you first to make sure I'm not misunderstanding something.
https://github.com/cantide5ga/yarn-npm_package_config-support demonstrates the bug.