-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Feature] Add support for package.json script variables #1659
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
- I'd be willing to implement a fix
Describe the bug
When using "yarn pack" in Yarn v1, package.json variables (such as npm_package_version) are honoured. This seems to not be th case in yarn v2.
To Reproduce
I have a package.json which defines a "pack" script like so:
"scripts": {
"pack": "yarn pack --filename my-file-v$npm_package_version.tar.gz",
}
The error when I run "yarn run pack" is Internal Error: Unbound variable "npm_package_version"
The minimal information needed to reproduce your issue (ideally a package.json with a single dep). Note that bugs without minimal reproductions might be closed.
Environment if relevant (please complete the following information):
- OS: Linux
- Node version 10.22.0
- Yarn version 2.1.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed