diff --git a/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap b/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap index 32cec32a23d0f..0c02b4b50432d 100644 --- a/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap +++ b/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap @@ -442,7 +442,9 @@ exports[`app --unit-test-runner vitest should add tsconfig.spec.json 1`] = ` }, "include": [ "vite.config.ts", + "vite.config.mts", "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.test.tsx", diff --git a/packages/nuxt/src/generators/application/__snapshots__/application.spec.ts.snap b/packages/nuxt/src/generators/application/__snapshots__/application.spec.ts.snap index 7b5070c264ac4..791cf976946da 100644 --- a/packages/nuxt/src/generators/application/__snapshots__/application.spec.ts.snap +++ b/packages/nuxt/src/generators/application/__snapshots__/application.spec.ts.snap @@ -168,7 +168,9 @@ exports[`app generated files content - as-provided - my-app general application "include": [ ".nuxt/nuxt.d.ts", "vite.config.ts", + "vite.config.mts", "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.test.tsx", @@ -531,7 +533,9 @@ exports[`app generated files content - as-provided - myApp general application s "include": [ ".nuxt/nuxt.d.ts", "vite.config.ts", + "vite.config.mts", "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.test.tsx", diff --git a/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap b/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap index 1b07895e18297..d60f1c263f45a 100644 --- a/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap +++ b/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap @@ -87,7 +87,9 @@ exports[`@nx/vite:configuration js library with --bundler=vite should add build "include": ["src/**/*.ts"], "exclude": [ "vite.config.ts", + "vite.config.mts", "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.test.tsx", diff --git a/packages/vite/src/generators/vitest/__snapshots__/vitest.spec.ts.snap b/packages/vite/src/generators/vitest/__snapshots__/vitest.spec.ts.snap index c3059ffe494c1..1e0ba890098d9 100644 --- a/packages/vite/src/generators/vitest/__snapshots__/vitest.spec.ts.snap +++ b/packages/vite/src/generators/vitest/__snapshots__/vitest.spec.ts.snap @@ -35,7 +35,7 @@ export default defineConfig({ `; exports[`vitest generator tsconfig should add vitest.workspace.ts at the root 1`] = ` -"export default ['**/*/vite.config.ts', '**/*/vitest.config.ts']; +"export default ['**/*/vite.config.{ts,mts}', '**/*/vitest.config.{ts,mts}']; " `; diff --git a/packages/vite/src/generators/vitest/files/tsconfig.spec.json__tmpl__ b/packages/vite/src/generators/vitest/files/tsconfig.spec.json__tmpl__ index 0f177b57ab70b..def52c91f19f0 100644 --- a/packages/vite/src/generators/vitest/files/tsconfig.spec.json__tmpl__ +++ b/packages/vite/src/generators/vitest/files/tsconfig.spec.json__tmpl__ @@ -6,7 +6,9 @@ }, "include": [ "vite.config.ts", + "vite.config.mts", "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.test.tsx", diff --git a/packages/vite/src/generators/vitest/vitest-generator.ts b/packages/vite/src/generators/vitest/vitest-generator.ts index f6b7b2f2d026a..771aa08fd60fb 100644 --- a/packages/vite/src/generators/vitest/vitest-generator.ts +++ b/packages/vite/src/generators/vitest/vitest-generator.ts @@ -138,7 +138,7 @@ export async function vitestGeneratorInternal( ) { tree.write( 'vitest.workspace.ts', - `export default ['**/*/vite.config.ts', '**/*/vitest.config.ts'];` + `export default ['**/*/vite.config.{ts,mts}', '**/*/vitest.config.{ts,mts}'];` ); } @@ -236,7 +236,9 @@ function updateTsConfig( const uniqueExclude = new Set([ ...(json.exclude || []), 'vite.config.ts', + 'vite.config.mts', 'vitest.config.ts', + 'vitest.config.mts', 'src/**/*.test.ts', 'src/**/*.spec.ts', 'src/**/*.test.tsx', diff --git a/packages/vite/src/generators/vitest/vitest.spec.ts b/packages/vite/src/generators/vitest/vitest.spec.ts index 01e0ada232945..30161e3517a7e 100644 --- a/packages/vite/src/generators/vitest/vitest.spec.ts +++ b/packages/vite/src/generators/vitest/vitest.spec.ts @@ -64,7 +64,9 @@ describe('vitest generator', () => { "extends": "./tsconfig.json", "include": [ "vite.config.ts", + "vite.config.mts", "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.test.tsx", diff --git a/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap b/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap index 3f3e8176a12b5..e5b5c73389b1e 100644 --- a/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap +++ b/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap @@ -205,7 +205,9 @@ exports[`library should add vue, vite and vitest to package.json 2`] = ` "src/**/*.spec.vue", "src/**/*.test.vue", "vite.config.ts", + "vite.config.mts", "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.test.tsx", @@ -261,7 +263,9 @@ exports[`library should ignore test files in tsconfig.lib.json 1`] = ` "src/**/*.spec.vue", "src/**/*.test.vue", "vite.config.ts", + "vite.config.mts", "vitest.config.ts", + "vitest.config.mts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.test.tsx",