Skip to content

Commit 55fd3bf

Browse files
leosvelperezFrozenPandaz
authored andcommitted
fix(js): do not generate explicit vitest task config for a js library unless adding plugin is disabled (#29606)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> Generating a js library with any bundler other than `vite` and with the `vitest` test runner results in an explicit `test` task in the project configuration. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Generating a js library with any bundler other than `vite` and with the `vitest` test runner should not generate an explicit `test` task in the project configuration. The `test` task should be inferred. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes # (cherry picked from commit a352c81)
1 parent 537099a commit 55fd3bf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/js/src/generators/library/library.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export async function libraryGeneratorInternal(
172172
testEnvironment: options.testEnvironment,
173173
runtimeTsconfigFileName: 'tsconfig.lib.json',
174174
compiler: options.compiler === 'swc' ? 'swc' : 'babel',
175+
addPlugin: options.addPlugin,
175176
});
176177
tasks.push(vitestTask);
177178
createOrEditViteConfig(

0 commit comments

Comments
 (0)