Open JasonGore opened 4 years ago
Thanks for the bug report.
It looks like rush rebuild will correctly handle an empty build script (printing out "had an empty script"), but does not handle the missing build script scenario. Rebuild should probably behave the same way build does, and should treat a missing script like an empty script when ingoreMissingScript
is set to true
.
Until a fix is available, you can set an empty build script as a workaround for rush rebuild.
"scripts": {
"build": ""
}
That's what I've had to do for now, but these types of script entries are incompatible with npm. If users try to run npm run build
in that package, it will error for some versions of Node.
will this bug be fixed ?
Note that if the "rebuild" command is overridden here, it becomes separated from the "build" command and will call the "rebuild" script instead of the "build" script.
⬆️ reference from the document,is this a feature ?
still can not ignore missing build script???
I would also like an option to ignore projects that do not contain the specified command. For example, my eslint
project in my repo defines configurations for all of the other projects, but I obviously don't need an eslint command for it because it has no files that the command would need to be ran on. The workaround works for now but I would prefer to keep a cleaner package.json
that doesn't contain unnecessary commands.
Is this a feature or a bug?
Please describe the actual behavior.
build
can be specified as a"ignoreMissingScript": true
and build will succeed successfully, ignoring any packages that do not have a script entry forbuild
.However, the default
rebuild
command will fail on said packages:If the issue is a bug, how can we reproduce it? Please provide detailed steps and include a GitHub branch if applicable. Your issue will get resolved faster if you can make it easy to investigate.
https://github.com/JasonGore/rush-build-rebuild-repro
rush install
rush build
, which will completely successfullyrush rebuild
, which will errorWhat is the expected behavior?
The default
rebuild
command should run without error ifbuild
is set toignoreMissingScript
.If this is a bug, please provide the tool version, Node.js version, and OS.