@nx/vite 22.7.0-rc.1 → 22.7.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/vite",
3
- "version": "22.7.0-rc.1",
3
+ "version": "22.7.0-rc.2",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for building and testing applications using Vite",
6
6
  "repository": {
@@ -31,11 +31,11 @@
31
31
  "migrations": "./migrations.json"
32
32
  },
33
33
  "dependencies": {
34
- "@nx/devkit": "22.7.0-rc.1",
34
+ "@nx/devkit": "22.7.0-rc.2",
35
35
  "@phenomnomnominal/tsquery": "~6.1.4",
36
36
  "enquirer": "~2.3.6",
37
- "@nx/js": "22.7.0-rc.1",
38
- "@nx/vitest": "22.7.0-rc.1",
37
+ "@nx/js": "22.7.0-rc.2",
38
+ "@nx/vitest": "22.7.0-rc.2",
39
39
  "picomatch": "4.0.4",
40
40
  "tsconfig-paths": "^4.1.2",
41
41
  "semver": "^7.6.3",
@@ -43,7 +43,7 @@
43
43
  "ajv": "^8.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "nx": "22.7.0-rc.1"
46
+ "nx": "22.7.0-rc.2"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
@@ -10,6 +10,13 @@ export interface VitePluginOptions {
10
10
  previewTargetName?: string;
11
11
  serveStaticTargetName?: string;
12
12
  typecheckTargetName?: string;
13
+ /**
14
+ * The compiler to use for type-checking. When unset, defaults to `vue-tsc`
15
+ * for Vue projects (detected via the `vite:vue` plugin) and `tsc` otherwise.
16
+ * Set to `tsgo` to use the TypeScript Go compiler (`@typescript/native-preview`),
17
+ * or `vue-tsc` to force Vue-aware type-checking when auto-detection misses your setup.
18
+ */
19
+ compiler?: 'tsc' | 'tsgo' | 'vue-tsc';
13
20
  watchDepsTargetName?: string;
14
21
  buildDepsTargetName?: string;
15
22
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/vite/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EASd,MAAM,YAAY,CAAC;AAmBpB,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAiBD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAgHxD,CAAC;AAEF,eAAO,MAAM,aAAa,kCAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/vite/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EASd,MAAM,YAAY,CAAC;AAmBpB,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAiBD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAgHxD,CAAC;AAEF,eAAO,MAAM,aAAa,kCAAc,CAAC"}
@@ -285,18 +285,22 @@ async function buildViteTargets(configFilePath, projectRoot, options, tsConfigFi
285
285
  const tsConfigToUse = ['tsconfig.app.json', 'tsconfig.lib.json', 'tsconfig.json'].find((t) => tsConfigFiles.includes(t)) ?? tsConfigFiles[0];
286
286
  // Check if the project uses Vue plugin
287
287
  const hasVuePlugin = viteBuildConfig.plugins?.some((p) => p.name === 'vite:vue');
288
- const typeCheckCommand = hasVuePlugin ? 'vue-tsc' : 'tsc';
288
+ // Explicit `compiler` option wins over inference so users can override
289
+ // when their setup isn't detected (e.g. custom/non-standard Vue plugin).
290
+ const resolvedCompiler = options.compiler ?? (hasVuePlugin ? 'vue-tsc' : 'tsc');
291
+ const typeCheckCommand = resolvedCompiler;
292
+ const typeCheckExternalDeps = resolvedCompiler === 'tsgo'
293
+ ? ['@typescript/native-preview']
294
+ : resolvedCompiler === 'vue-tsc'
295
+ ? ['vue-tsc', 'typescript']
296
+ : ['typescript'];
289
297
  targets[options.typecheckTargetName] = {
290
298
  cache: true,
291
299
  inputs: [
292
300
  ...('production' in namedInputs
293
301
  ? ['production', '^production']
294
302
  : ['default', '^default']),
295
- {
296
- externalDependencies: hasVuePlugin
297
- ? ['vue-tsc', 'typescript']
298
- : ['typescript'],
299
- },
303
+ { externalDependencies: typeCheckExternalDeps },
300
304
  ],
301
305
  command: isUsingTsSolutionSetup
302
306
  ? `${typeCheckCommand} --build --emitDeclarationOnly`