Closed jsmecham closed 1 month ago
The above repo does not seem to have any of the package.json
scripts that you described. Could you check if your changes were pushed please?
There are several things which are already in place for this sort of issue.
nx add @nx/vite
, Nx will configure the plugin added to not conflict with any existing scripts. So in cases where you have a package.json
script called build
(which also creates an Nx target named build
), the @nx/vite/plugin
plugin will be configured to create vite:build
targets instead.package.json
scripts in Nx by setting nx.includedScripts = []
in your package.json
. This will create only the script names in that array in Nx.Hopefully one of those above helps your issue. If not, please verify that your changes have been pushed and I can take a look.
Oops! I forgot to push. I've done so now.
However, includedScripts
looks like it does exactly what I want. For some reason, I did not see that section as I was scouring for an option. My apologies!
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
When using inferred tasks as part of Project Crystal, an infinite loop occurs when the
package.json
of a project uses a script name that matches an inferred task name.For example, when running
nx build test-a
(see configuration below), it just continuously invokesnx build
:Configuration
nx.json
packages/test-a/package.json
packages/test-a/project.json
Expected Behavior
I would expect the inferred task to continue to work by calling
nx build
. The use case here is that I'd like my team to be able to use bothnpm run build
(muscle memory) andnpx nx build
to perform the same thing and to ease adoption of Nx.An option to disable inferring
package.json
scripts as tasks would be helpful, but at the very least, this infinite loop behavior should be recognized or documented.GitHub Repo
https://github.com/jsmecham/nx-inferred-tasks-with-package-scripts
Steps to Reproduce
npx nx build test-b
and observe working behaviornpx nx build test-a
and observe broken behaviorNx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response