This PR ensures that when `@nx/js/typescript` is not used, we do not add `@nx/js:typescript-sync` sync generator to targets such as build, serve, etc. It resolves issues where `nx init` into a repo that is compatible with TS solution will add the sync generator, even if the plugin is unused. It leads to errors everytime users run a task like build. The error is like this: ``` [@nx/js:typescript-sync] The `@nx/js/typescript` plugin is not registered ... > Would you like to ignore the sync failures and continue running the task? Yes No ``` It makes it confusing for users, especially new users that don't know what sync generators are. They will always run into the error and have to choose to continue despite the failure. **Note:** In a future follow-up, we could consider adding better info and prompts so we can let users know that Nx also helps keep workspace up to date, and can learn more about it. ## Current Behavior Users see an error when running `nx add @nx/vite` and then `nx build <project>`. ## Expected Behavior ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
{{links}}
Nx: Smart Monorepos · Fast CI
Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
This package is a JavaScript/TypeScript plugin for Nx.
{{content}}