@nx/vite 22.7.0-beta.1 → 22.7.0-beta.11

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.
Files changed (49) hide show
  1. package/package.json +10 -11
  2. package/plugins/nx-vite-build-coordination.plugin.js +1 -1
  3. package/src/executors/build/build.impl.d.ts.map +1 -1
  4. package/src/executors/build/build.impl.js +40 -3
  5. package/src/executors/build/compat.js +2 -1
  6. package/src/executors/build/schema.json +75 -75
  7. package/src/executors/dev-server/compat.js +2 -1
  8. package/src/executors/dev-server/dev-server.impl.js +34 -1
  9. package/src/executors/dev-server/schema.json +36 -36
  10. package/src/executors/preview-server/compat.js +2 -1
  11. package/src/executors/preview-server/preview-server.impl.js +34 -1
  12. package/src/executors/preview-server/schema.json +40 -40
  13. package/src/executors/test/compat.js +2 -1
  14. package/src/executors/test/schema.json +33 -33
  15. package/src/executors/test/vitest.impl.js +34 -1
  16. package/src/generators/configuration/configuration.js +3 -2
  17. package/src/generators/configuration/schema.d.ts +1 -0
  18. package/src/generators/configuration/schema.json +62 -62
  19. package/src/generators/convert-to-inferred/schema.json +16 -16
  20. package/src/generators/init/lib/utils.d.ts.map +1 -1
  21. package/src/generators/init/lib/utils.js +51 -9
  22. package/src/generators/init/schema.d.ts +1 -0
  23. package/src/generators/init/schema.json +54 -47
  24. package/src/generators/setup-paths-plugin/schema.json +11 -11
  25. package/src/generators/vitest/schema.json +62 -62
  26. package/src/generators/vitest/vitest-generator.js +34 -1
  27. package/src/migrations/update-20-5-0/eslint-ignore-vite-temp-files.js +35 -2
  28. package/src/plugins/plugin.d.ts.map +1 -1
  29. package/src/plugins/plugin.js +56 -17
  30. package/src/utils/ensure-dependencies.d.ts.map +1 -1
  31. package/src/utils/ensure-dependencies.js +9 -1
  32. package/src/utils/executor-utils.js +1 -1
  33. package/src/utils/ignore-vite-temp-files.js +35 -2
  34. package/src/utils/version-utils.d.ts +2 -0
  35. package/src/utils/version-utils.d.ts.map +1 -1
  36. package/src/utils/version-utils.js +22 -0
  37. package/src/utils/versions.d.ts +11 -9
  38. package/src/utils/versions.d.ts.map +1 -1
  39. package/src/utils/versions.js +9 -7
  40. package/project.json +0 -52
  41. package/src/utils/test-files/angular-project.config.json +0 -89
  42. package/src/utils/test-files/react-lib-non-buildable-jest.json +0 -22
  43. package/src/utils/test-files/react-lib-non-buildable-vitest.json +0 -22
  44. package/src/utils/test-files/react-mixed-project.config.json +0 -47
  45. package/src/utils/test-files/react-vite-project.config.json +0 -54
  46. package/src/utils/test-files/unknown-project.config.json +0 -69
  47. package/src/utils/test-utils.d.ts +0 -10
  48. package/src/utils/test-utils.d.ts.map +0 -1
  49. package/src/utils/test-utils.js +0 -563
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/vite",
3
- "version": "22.7.0-beta.1",
3
+ "version": "22.7.0-beta.11",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for building and testing applications using Vite",
6
6
  "repository": {
@@ -16,7 +16,8 @@
16
16
  "Front-end"
17
17
  ],
18
18
  "main": "./index.js",
19
- "typings": "./index.d.ts",
19
+ "type": "commonjs",
20
+ "types": "./index.d.ts",
20
21
  "author": "Victor Savkin",
21
22
  "license": "MIT",
22
23
  "bugs": {
@@ -30,22 +31,22 @@
30
31
  "migrations": "./migrations.json"
31
32
  },
32
33
  "dependencies": {
33
- "@nx/devkit": "22.7.0-beta.1",
34
+ "@nx/devkit": "22.7.0-beta.11",
34
35
  "@phenomnomnominal/tsquery": "~6.1.4",
35
36
  "enquirer": "~2.3.6",
36
- "@nx/js": "22.7.0-beta.1",
37
- "@nx/vitest": "22.7.0-beta.1",
38
- "picomatch": "4.0.2",
37
+ "@nx/js": "22.7.0-beta.11",
38
+ "@nx/vitest": "22.7.0-beta.11",
39
+ "picomatch": "4.0.4",
39
40
  "tsconfig-paths": "^4.1.2",
40
41
  "semver": "^7.6.3",
41
42
  "tslib": "^2.3.0",
42
43
  "ajv": "^8.0.0"
43
44
  },
44
45
  "devDependencies": {
45
- "nx": "22.7.0-beta.1"
46
+ "nx": "22.7.0-beta.11"
46
47
  },
47
48
  "peerDependencies": {
48
- "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
49
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
49
50
  "vitest": "^1.3.1 || ^2.0.0 || ^3.0.0 || ^4.0.0"
50
51
  },
51
52
  "publishConfig": {
@@ -68,7 +69,5 @@
68
69
  "./plugins/nx-copy-assets.plugin": "./plugins/nx-copy-assets.plugin.js",
69
70
  "./plugins/nx-tsconfig-paths.plugin": "./plugins/nx-tsconfig-paths.plugin.js",
70
71
  "./plugins/rollup-replace-files.plugin": "./plugins/rollup-replace-files.plugin.js"
71
- },
72
- "types": "./index.d.ts",
73
- "type": "commonjs"
72
+ }
74
73
  }
@@ -11,7 +11,7 @@ function nxViteBuildCoordinationPlugin(options) {
11
11
  async function buildChangedProjects() {
12
12
  await new Promise((res) => {
13
13
  activeBuildProcess = (0, child_process_1.exec)(options.buildCommand, {
14
- windowsHide: false,
14
+ windowsHide: true,
15
15
  });
16
16
  activeBuildProcess.stdout.pipe(process.stdout);
17
17
  activeBuildProcess.stderr.pipe(process.stderr);
@@ -1 +1 @@
1
- {"version":3,"file":"build.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/vite/src/executors/build/build.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAMhB,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAqBpD,wBAAuB,iBAAiB,CACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,wBAAwB,EACvD,OAAO,EAAE,eAAe;aA+EgB,OAAO;cAAY,MAAM;aAgIlE;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC;IAET,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,CAAC,CAsDD;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"build.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/vite/src/executors/build/build.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAMhB,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAqBpD,wBAAuB,iBAAiB,CACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,wBAAwB,EACvD,OAAO,EAAE,eAAe;aA+EgB,OAAO;cAAY,MAAM;aAmIlE;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC;IAET,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,CAAC,CAuDD;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.viteBuildExecutor = viteBuildExecutor;
4
37
  exports.getBuildExtraArgs = getBuildExtraArgs;
@@ -57,8 +90,11 @@ async function* viteBuildExecutor(options, context) {
57
90
  };
58
91
  let iterables = [];
59
92
  for (const env of Object.values(builder.environments)) {
60
- // This is needed to overwrite the resolve build config with executor options in Vite 6
61
- if (env.config?.build) {
93
+ // Overwrite the resolved build config with executor options (e.g. outDir).
94
+ // Skip when using the builder API (Vite 8+) as the builder already
95
+ // resolves environment configs correctly and overwriting would clobber
96
+ // environment-specific options like rollupOptions/rolldownOptions.
97
+ if (env.config?.build && !options.useEnvironmentsApi) {
62
98
  env.config.build = {
63
99
  ...env.config.build,
64
100
  ...buildConfig.build,
@@ -148,7 +184,7 @@ async function* viteBuildExecutor(options, context) {
148
184
  }
149
185
  async function getBuildExtraArgs(options) {
150
186
  // support passing extra args to vite cli
151
- const schema = await Promise.resolve().then(() => require('./schema.json'));
187
+ const schema = await Promise.resolve().then(() => __importStar(require('./schema.json')));
152
188
  const extraArgs = {};
153
189
  for (const key of Object.keys(options)) {
154
190
  if (!schema.properties[key]) {
@@ -170,6 +206,7 @@ async function getBuildExtraArgs(options) {
170
206
  'minify',
171
207
  'terserOptions',
172
208
  'rollupOptions',
209
+ 'rolldownOptions',
173
210
  'commonjsOptions',
174
211
  'dynamicImportVarsOptions',
175
212
  'write',
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
3
4
  const devkit_1 = require("@nx/devkit");
4
- const build_impl_1 = require("./build.impl");
5
+ const build_impl_1 = tslib_1.__importDefault(require("./build.impl"));
5
6
  exports.default = (0, devkit_1.convertNxExecutor)(build_impl_1.default);
@@ -1,81 +1,81 @@
1
1
  {
2
- "version": 2,
3
- "outputCapture": "direct-nodejs",
4
- "title": "Vite Prod Builder",
5
- "cli": "nx",
6
- "description": "Builds a Vite application for production.",
7
- "type": "object",
8
- "presets": [
9
- {
10
- "name": "Default minimum setup",
11
- "keys": []
12
- }
13
- ],
14
- "properties": {
15
- "outputPath": {
16
- "type": "string",
17
- "description": "The output path of the generated files.",
18
- "x-completion-type": "directory",
19
- "x-priority": "important"
20
- },
21
- "buildLibsFromSource": {
22
- "type": "boolean",
23
- "description": "Read buildable libraries from source instead of building them separately.",
24
- "default": true
25
- },
26
- "skipTypeCheck": {
27
- "type": "boolean",
28
- "description": "Skip type-checking via TypeScript. Skipping type-checking speeds up the build but type errors are not caught.",
29
- "default": false
30
- },
31
- "tsConfig": {
32
- "type": "string",
33
- "description": "The path to custom tsconfig file for type-checking when skipTypeCheck is false. Required when tsconfig file is not at the projectRoot level.",
34
- "x-completion-type": "file",
35
- "x-completion-glob": "tsconfig.*.json"
36
- },
37
- "configFile": {
38
- "type": "string",
39
- "description": "The name of the Vite configuration file.",
40
- "x-completion-type": "file",
41
- "x-completion-glob": "vite.config.@(js|ts)"
42
- },
43
- "watch": {
44
- "description": "Enable re-building when files change.",
45
- "oneOf": [
2
+ "version": 2,
3
+ "outputCapture": "direct-nodejs",
4
+ "title": "Vite Prod Builder",
5
+ "cli": "nx",
6
+ "description": "Builds a Vite application for production.",
7
+ "type": "object",
8
+ "presets": [
46
9
  {
47
- "type": "boolean"
10
+ "name": "Default minimum setup",
11
+ "keys": []
12
+ }
13
+ ],
14
+ "properties": {
15
+ "outputPath": {
16
+ "type": "string",
17
+ "description": "The output path of the generated files.",
18
+ "x-completion-type": "directory",
19
+ "x-priority": "important"
48
20
  },
49
- {
50
- "type": "object"
21
+ "buildLibsFromSource": {
22
+ "type": "boolean",
23
+ "description": "Read buildable libraries from source instead of building them separately.",
24
+ "default": true
25
+ },
26
+ "skipTypeCheck": {
27
+ "type": "boolean",
28
+ "description": "Skip type-checking via TypeScript. Skipping type-checking speeds up the build but type errors are not caught.",
29
+ "default": false
30
+ },
31
+ "tsConfig": {
32
+ "type": "string",
33
+ "description": "The path to custom tsconfig file for type-checking when skipTypeCheck is false. Required when tsconfig file is not at the projectRoot level.",
34
+ "x-completion-type": "file",
35
+ "x-completion-glob": "tsconfig.*.json"
36
+ },
37
+ "configFile": {
38
+ "type": "string",
39
+ "description": "The name of the Vite configuration file.",
40
+ "x-completion-type": "file",
41
+ "x-completion-glob": "vite.config.@(js|ts)"
42
+ },
43
+ "watch": {
44
+ "description": "Enable re-building when files change.",
45
+ "oneOf": [
46
+ {
47
+ "type": "boolean"
48
+ },
49
+ {
50
+ "type": "object"
51
+ }
52
+ ],
53
+ "default": false
54
+ },
55
+ "generatePackageJson": {
56
+ "description": "Generate a package.json for the build output.",
57
+ "type": "boolean"
58
+ },
59
+ "includeDevDependenciesInPackageJson": {
60
+ "description": "Include devDependencies in the generated package.json.",
61
+ "type": "boolean"
62
+ },
63
+ "skipOverrides": {
64
+ "type": "boolean",
65
+ "description": "Do not add a `overrides` and `resolutions` entries to the generated package.json file. Only works in conjunction with `generatePackageJson` option."
66
+ },
67
+ "skipPackageManager": {
68
+ "type": "boolean",
69
+ "description": "Do not add a `packageManager` entry to the generated package.json file. Only works in conjunction with `generatePackageJson` option."
70
+ },
71
+ "useEnvironmentsApi": {
72
+ "alias": "app",
73
+ "type": "boolean",
74
+ "description": "Use the new Environments API for building multiple environments at once. Only works with Vite 6.0.0 or higher.",
75
+ "default": false
51
76
  }
52
- ],
53
- "default": false
54
- },
55
- "generatePackageJson": {
56
- "description": "Generate a package.json for the build output.",
57
- "type": "boolean"
58
- },
59
- "includeDevDependenciesInPackageJson": {
60
- "description": "Include devDependencies in the generated package.json.",
61
- "type": "boolean"
62
- },
63
- "skipOverrides": {
64
- "type": "boolean",
65
- "description": "Do not add a `overrides` and `resolutions` entries to the generated package.json file. Only works in conjunction with `generatePackageJson` option."
66
- },
67
- "skipPackageManager": {
68
- "type": "boolean",
69
- "description": "Do not add a `packageManager` entry to the generated package.json file. Only works in conjunction with `generatePackageJson` option."
70
77
  },
71
- "useEnvironmentsApi": {
72
- "alias": "app",
73
- "type": "boolean",
74
- "description": "Use the new Environments API for building multiple environments at once. Only works with Vite 6.0.0 or higher.",
75
- "default": false
76
- }
77
- },
78
- "definitions": {},
79
- "required": [],
80
- "examplesFile": "../../../docs/build-examples.md"
78
+ "definitions": {},
79
+ "required": [],
80
+ "examplesFile": "../../../docs/build-examples.md"
81
81
  }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
3
4
  const devkit_1 = require("@nx/devkit");
4
- const dev_server_impl_1 = require("./dev-server.impl");
5
+ const dev_server_impl_1 = tslib_1.__importDefault(require("./dev-server.impl"));
5
6
  exports.default = (0, devkit_1.convertNxExecutor)(dev_server_impl_1.default);
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.viteDevServerExecutor = viteDevServerExecutor;
4
37
  const devkit_1 = require("@nx/devkit");
@@ -78,7 +111,7 @@ async function runViteDevServer(server) {
78
111
  exports.default = viteDevServerExecutor;
79
112
  async function getServerExtraArgs(options, configuration, buildOptionsFromBuildTarget, otherOptionsFromBuildTarget) {
80
113
  // support passing extra args to vite cli
81
- const schema = await Promise.resolve().then(() => require('./schema.json'));
114
+ const schema = await Promise.resolve().then(() => __importStar(require('./schema.json')));
82
115
  const extraArgs = {};
83
116
  for (const key of Object.keys(options)) {
84
117
  if (!schema.properties[key]) {
@@ -1,39 +1,39 @@
1
1
  {
2
- "version": 2,
3
- "continuous": true,
4
- "outputCapture": "direct-nodejs",
5
- "title": "Vite Dev Server",
6
- "cli": "nx",
7
- "description": "Starts a dev server using Vite.",
8
- "type": "object",
9
- "presets": [
10
- {
11
- "name": "Default minimum setup",
12
- "keys": ["buildTarget"]
2
+ "version": 2,
3
+ "continuous": true,
4
+ "outputCapture": "direct-nodejs",
5
+ "title": "Vite Dev Server",
6
+ "cli": "nx",
7
+ "description": "Starts a dev server using Vite.",
8
+ "type": "object",
9
+ "presets": [
10
+ {
11
+ "name": "Default minimum setup",
12
+ "keys": ["buildTarget"]
13
+ },
14
+ {
15
+ "name": "Using a Different Port",
16
+ "keys": ["buildTarget", "port"]
17
+ }
18
+ ],
19
+ "properties": {
20
+ "buildTarget": {
21
+ "type": "string",
22
+ "description": "Target which builds the application. Only used to retrieve the configuration as the dev-server does not build the code.",
23
+ "x-priority": "important"
24
+ },
25
+ "buildLibsFromSource": {
26
+ "type": "boolean",
27
+ "description": "Read buildable libraries from source instead of building them separately.",
28
+ "default": true
29
+ },
30
+ "proxyConfig": {
31
+ "type": "string",
32
+ "description": "Path to the proxy configuration file.",
33
+ "x-completion-type": "file"
34
+ }
13
35
  },
14
- {
15
- "name": "Using a Different Port",
16
- "keys": ["buildTarget", "port"]
17
- }
18
- ],
19
- "properties": {
20
- "buildTarget": {
21
- "type": "string",
22
- "description": "Target which builds the application. Only used to retrieve the configuration as the dev-server does not build the code.",
23
- "x-priority": "important"
24
- },
25
- "buildLibsFromSource": {
26
- "type": "boolean",
27
- "description": "Read buildable libraries from source instead of building them separately.",
28
- "default": true
29
- },
30
- "proxyConfig": {
31
- "type": "string",
32
- "description": "Path to the proxy configuration file.",
33
- "x-completion-type": "file"
34
- }
35
- },
36
- "definitions": {},
37
- "required": ["buildTarget"],
38
- "examplesFile": "../../../docs/dev-server-examples.md"
36
+ "definitions": {},
37
+ "required": ["buildTarget"],
38
+ "examplesFile": "../../../docs/dev-server-examples.md"
39
39
  }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
3
4
  const devkit_1 = require("@nx/devkit");
4
- const preview_server_impl_1 = require("./preview-server.impl");
5
+ const preview_server_impl_1 = tslib_1.__importDefault(require("./preview-server.impl"));
5
6
  exports.default = (0, devkit_1.convertNxExecutor)(preview_server_impl_1.default);
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.vitePreviewServerExecutor = vitePreviewServerExecutor;
4
37
  const devkit_1 = require("@nx/devkit");
@@ -141,7 +174,7 @@ function closeServer(server) {
141
174
  exports.default = vitePreviewServerExecutor;
142
175
  async function getExtraArgs(options, configuration, otherOptionsFromBuildTarget) {
143
176
  // support passing extra args to vite cli
144
- const schema = await Promise.resolve().then(() => require('./schema.json'));
177
+ const schema = await Promise.resolve().then(() => __importStar(require('./schema.json')));
145
178
  const extraArgs = {};
146
179
  for (const key of Object.keys(options)) {
147
180
  if (!schema.properties[key]) {
@@ -1,43 +1,43 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "version": 2,
4
- "cli": "nx",
5
- "title": "Vite Preview Server",
6
- "description": "Preview Server for Vite.",
7
- "continuous": true,
8
- "type": "object",
9
- "presets": [
10
- {
11
- "name": "Default minimum setup",
12
- "keys": ["buildTarget"]
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "cli": "nx",
5
+ "title": "Vite Preview Server",
6
+ "description": "Preview Server for Vite.",
7
+ "continuous": true,
8
+ "type": "object",
9
+ "presets": [
10
+ {
11
+ "name": "Default minimum setup",
12
+ "keys": ["buildTarget"]
13
+ },
14
+ {
15
+ "name": "Using a Different Port",
16
+ "keys": ["buildTarget", "port"]
17
+ }
18
+ ],
19
+ "properties": {
20
+ "buildTarget": {
21
+ "type": "string",
22
+ "description": "Target which builds the application."
23
+ },
24
+ "proxyConfig": {
25
+ "type": "string",
26
+ "description": "Path to the proxy configuration file.",
27
+ "x-completion-type": "file"
28
+ },
29
+ "staticFilePath": {
30
+ "type": "string",
31
+ "description": "Path where the build artifacts are located. If not provided then it will be infered from the buildTarget executor options as outputPath",
32
+ "x-completion-type": "directory"
33
+ },
34
+ "watch": {
35
+ "type": "boolean",
36
+ "description": "Enable re-building when files change. If not specified, watch mode will be enabled by default.",
37
+ "default": true
38
+ }
13
39
  },
14
- {
15
- "name": "Using a Different Port",
16
- "keys": ["buildTarget", "port"]
17
- }
18
- ],
19
- "properties": {
20
- "buildTarget": {
21
- "type": "string",
22
- "description": "Target which builds the application."
23
- },
24
- "proxyConfig": {
25
- "type": "string",
26
- "description": "Path to the proxy configuration file.",
27
- "x-completion-type": "file"
28
- },
29
- "staticFilePath": {
30
- "type": "string",
31
- "description": "Path where the build artifacts are located. If not provided then it will be infered from the buildTarget executor options as outputPath",
32
- "x-completion-type": "directory"
33
- },
34
- "watch": {
35
- "type": "boolean",
36
- "description": "Enable re-building when files change. If not specified, watch mode will be enabled by default.",
37
- "default": true
38
- }
39
- },
40
- "definitions": {},
41
- "required": ["buildTarget"],
42
- "examplesFile": "../../../docs/preview-server-examples.md"
40
+ "definitions": {},
41
+ "required": ["buildTarget"],
42
+ "examplesFile": "../../../docs/preview-server-examples.md"
43
43
  }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
3
4
  const devkit_1 = require("@nx/devkit");
4
- const vitest_impl_1 = require("./vitest.impl");
5
+ const vitest_impl_1 = tslib_1.__importDefault(require("./vitest.impl"));
5
6
  exports.default = (0, devkit_1.convertNxExecutor)(vitest_impl_1.default);
@@ -1,36 +1,36 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "version": 2,
4
- "cli": "nx",
5
- "title": "Vitest executor",
6
- "description": "Test using Vitest.",
7
- "type": "object",
8
- "properties": {
9
- "configFile": {
10
- "type": "string",
11
- "description": "The path to the local vitest config, relative to the workspace root.",
12
- "x-completion-type": "file",
13
- "x-completion-glob": "@(vitest|vite).config@(.js|.ts)",
14
- "aliases": ["config"]
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "cli": "nx",
5
+ "title": "Vitest executor",
6
+ "description": "Test using Vitest.",
7
+ "type": "object",
8
+ "properties": {
9
+ "configFile": {
10
+ "type": "string",
11
+ "description": "The path to the local vitest config, relative to the workspace root.",
12
+ "x-completion-type": "file",
13
+ "x-completion-glob": "@(vitest|vite).config@(.js|.ts)",
14
+ "aliases": ["config"]
15
+ },
16
+ "reportsDirectory": {
17
+ "type": "string",
18
+ "description": "Directory to write coverage report to."
19
+ },
20
+ "mode": {
21
+ "type": "string",
22
+ "description": "Mode for Vite."
23
+ },
24
+ "testFiles": {
25
+ "aliases": ["testFile"],
26
+ "type": "array",
27
+ "items": { "type": "string" }
28
+ },
29
+ "watch": {
30
+ "description": "Watch files for changes and rerun tests related to changed files.",
31
+ "type": "boolean"
32
+ }
15
33
  },
16
- "reportsDirectory": {
17
- "type": "string",
18
- "description": "Directory to write coverage report to."
19
- },
20
- "mode": {
21
- "type": "string",
22
- "description": "Mode for Vite."
23
- },
24
- "testFiles": {
25
- "aliases": ["testFile"],
26
- "type": "array",
27
- "items": { "type": "string" }
28
- },
29
- "watch": {
30
- "description": "Watch files for changes and rerun tests related to changed files.",
31
- "type": "boolean"
32
- }
33
- },
34
- "required": [],
35
- "examplesFile": "../../../docs/test-examples.md"
34
+ "required": [],
35
+ "examplesFile": "../../../docs/test-examples.md"
36
36
  }