@nx/vite 21.3.7 → 21.4.0-beta.1

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 (222) hide show
  1. package/executors.d.ts +1 -0
  2. package/executors.d.ts.map +1 -0
  3. package/executors.js +10 -26
  4. package/index.d.ts +1 -0
  5. package/index.d.ts.map +1 -0
  6. package/index.js +12 -26
  7. package/package.json +7 -4
  8. package/plugin.d.ts +1 -0
  9. package/plugin.d.ts.map +1 -0
  10. package/plugin.js +6 -23
  11. package/plugins/nx-copy-assets.plugin.d.ts +1 -0
  12. package/plugins/nx-copy-assets.plugin.d.ts.map +1 -0
  13. package/plugins/nx-copy-assets.plugin.js +28 -30
  14. package/plugins/nx-tsconfig-paths.plugin.d.ts +1 -0
  15. package/plugins/nx-tsconfig-paths.plugin.d.ts.map +1 -0
  16. package/plugins/nx-tsconfig-paths.plugin.js +86 -88
  17. package/plugins/nx-vite-build-coordination.plugin.d.ts +1 -0
  18. package/plugins/nx-vite-build-coordination.plugin.d.ts.map +1 -0
  19. package/plugins/nx-vite-build-coordination.plugin.js +25 -32
  20. package/plugins/rollup-replace-files.plugin.d.ts +1 -0
  21. package/plugins/rollup-replace-files.plugin.d.ts.map +1 -0
  22. package/plugins/rollup-replace-files.plugin.js +20 -26
  23. package/project.json +52 -0
  24. package/src/executors/build/build.impl.d.ts +1 -0
  25. package/src/executors/build/build.impl.d.ts.map +1 -0
  26. package/src/executors/build/build.impl.js +98 -112
  27. package/src/executors/build/compat.d.ts +1 -0
  28. package/src/executors/build/compat.d.ts.map +1 -0
  29. package/src/executors/build/compat.js +4 -11
  30. package/src/executors/dev-server/compat.d.ts +1 -0
  31. package/src/executors/dev-server/compat.d.ts.map +1 -0
  32. package/src/executors/dev-server/compat.js +4 -11
  33. package/src/executors/dev-server/dev-server.impl.d.ts +1 -0
  34. package/src/executors/dev-server/dev-server.impl.d.ts.map +1 -0
  35. package/src/executors/dev-server/dev-server.impl.js +54 -62
  36. package/src/executors/preview-server/compat.d.ts +1 -0
  37. package/src/executors/preview-server/compat.d.ts.map +1 -0
  38. package/src/executors/preview-server/compat.js +4 -11
  39. package/src/executors/preview-server/preview-server.impl.d.ts +1 -0
  40. package/src/executors/preview-server/preview-server.impl.d.ts.map +1 -0
  41. package/src/executors/preview-server/preview-server.impl.js +74 -77
  42. package/src/executors/test/compat.d.ts +1 -0
  43. package/src/executors/test/compat.d.ts.map +1 -0
  44. package/src/executors/test/compat.js +4 -11
  45. package/src/executors/test/lib/nx-reporter.d.ts +1 -0
  46. package/src/executors/test/lib/nx-reporter.d.ts.map +1 -0
  47. package/src/executors/test/lib/nx-reporter.js +17 -25
  48. package/src/executors/test/lib/utils.d.ts +1 -0
  49. package/src/executors/test/lib/utils.d.ts.map +1 -0
  50. package/src/executors/test/lib/utils.js +36 -59
  51. package/src/executors/test/vitest.impl.d.ts +1 -0
  52. package/src/executors/test/vitest.impl.d.ts.map +1 -0
  53. package/src/executors/test/vitest.impl.js +29 -43
  54. package/src/generators/configuration/configuration.d.ts +1 -0
  55. package/src/generators/configuration/configuration.d.ts.map +1 -0
  56. package/src/generators/configuration/configuration.js +82 -102
  57. package/src/generators/configuration/lib/convert-non-vite.d.ts +1 -0
  58. package/src/generators/configuration/lib/convert-non-vite.d.ts.map +1 -0
  59. package/src/generators/configuration/lib/convert-non-vite.js +33 -32
  60. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts +1 -0
  61. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -0
  62. package/src/generators/convert-to-inferred/convert-to-inferred.js +31 -61
  63. package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts +1 -0
  64. package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts.map +1 -0
  65. package/src/generators/convert-to-inferred/lib/build-post-target-transformer.js +46 -58
  66. package/src/generators/convert-to-inferred/lib/preview-post-target-transformer.d.ts +1 -0
  67. package/src/generators/convert-to-inferred/lib/preview-post-target-transformer.d.ts.map +1 -0
  68. package/src/generators/convert-to-inferred/lib/preview-post-target-transformer.js +9 -14
  69. package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts +1 -0
  70. package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts.map +1 -0
  71. package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.js +10 -15
  72. package/src/generators/convert-to-inferred/lib/test-post-target-transformer.d.ts +1 -0
  73. package/src/generators/convert-to-inferred/lib/test-post-target-transformer.d.ts.map +1 -0
  74. package/src/generators/convert-to-inferred/lib/test-post-target-transformer.js +16 -23
  75. package/src/generators/convert-to-inferred/lib/utils.d.ts +1 -0
  76. package/src/generators/convert-to-inferred/lib/utils.d.ts.map +1 -0
  77. package/src/generators/convert-to-inferred/lib/utils.js +18 -33
  78. package/src/generators/init/init.d.ts +1 -0
  79. package/src/generators/init/init.d.ts.map +1 -0
  80. package/src/generators/init/init.js +44 -96
  81. package/src/generators/init/lib/utils.d.ts +1 -0
  82. package/src/generators/init/lib/utils.d.ts.map +1 -0
  83. package/src/generators/init/lib/utils.js +20 -35
  84. package/src/generators/setup-paths-plugin/lib/utils.d.ts +1 -0
  85. package/src/generators/setup-paths-plugin/lib/utils.d.ts.map +1 -0
  86. package/src/generators/setup-paths-plugin/lib/utils.js +0 -3
  87. package/src/generators/setup-paths-plugin/setup-paths-plugin.d.ts +1 -0
  88. package/src/generators/setup-paths-plugin/setup-paths-plugin.d.ts.map +1 -0
  89. package/src/generators/setup-paths-plugin/setup-paths-plugin.js +45 -54
  90. package/src/generators/vitest/vitest-generator.d.ts +1 -0
  91. package/src/generators/vitest/vitest-generator.d.ts.map +1 -0
  92. package/src/generators/vitest/vitest-generator.js +134 -174
  93. package/src/migrations/update-19-6-0/add-depends-on-for-preview.d.ts +1 -0
  94. package/src/migrations/update-19-6-0/add-depends-on-for-preview.d.ts.map +1 -0
  95. package/src/migrations/update-19-6-0/add-depends-on-for-preview.js +10 -18
  96. package/src/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore.d.ts +1 -0
  97. package/src/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore.d.ts.map +1 -0
  98. package/src/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore.js +4 -10
  99. package/src/migrations/update-20-3-0/add-vitest-temp-files-to-git-ignore.d.ts +1 -0
  100. package/src/migrations/update-20-3-0/add-vitest-temp-files-to-git-ignore.d.ts.map +1 -0
  101. package/src/migrations/update-20-3-0/add-vitest-temp-files-to-git-ignore.js +4 -10
  102. package/src/migrations/update-20-5-0/eslint-ignore-vite-temp-files.d.ts +1 -0
  103. package/src/migrations/update-20-5-0/eslint-ignore-vite-temp-files.d.ts.map +1 -0
  104. package/src/migrations/update-20-5-0/eslint-ignore-vite-temp-files.js +20 -24
  105. package/src/migrations/update-20-5-0/install-jiti.d.ts +1 -0
  106. package/src/migrations/update-20-5-0/install-jiti.d.ts.map +1 -0
  107. package/src/migrations/update-20-5-0/install-jiti.js +6 -12
  108. package/src/migrations/update-20-5-0/update-resolve-conditions.d.ts +1 -0
  109. package/src/migrations/update-20-5-0/update-resolve-conditions.d.ts.map +1 -0
  110. package/src/migrations/update-20-5-0/update-resolve-conditions.js +26 -28
  111. package/src/plugins/plugin.d.ts +1 -0
  112. package/src/plugins/plugin.d.ts.map +1 -0
  113. package/src/plugins/plugin.js +189 -267
  114. package/src/utils/detect-ui-framework.d.ts +1 -0
  115. package/src/utils/detect-ui-framework.d.ts.map +1 -0
  116. package/src/utils/detect-ui-framework.js +9 -20
  117. package/src/utils/e2e-web-server-info-utils.d.ts +1 -0
  118. package/src/utils/e2e-web-server-info-utils.d.ts.map +1 -0
  119. package/src/utils/e2e-web-server-info-utils.js +23 -35
  120. package/src/utils/ensure-dependencies.d.ts +1 -0
  121. package/src/utils/ensure-dependencies.d.ts.map +1 -0
  122. package/src/utils/ensure-dependencies.js +24 -26
  123. package/src/utils/executor-utils.d.ts +1 -0
  124. package/src/utils/executor-utils.d.ts.map +1 -0
  125. package/src/utils/executor-utils.js +27 -43
  126. package/src/utils/find-vite-config.d.ts +1 -0
  127. package/src/utils/find-vite-config.d.ts.map +1 -0
  128. package/src/utils/find-vite-config.js +12 -37
  129. package/src/utils/generator-utils.d.ts +1 -0
  130. package/src/utils/generator-utils.d.ts.map +1 -0
  131. package/src/utils/generator-utils.js +204 -216
  132. package/src/utils/ignore-vite-temp-files.d.ts +1 -0
  133. package/src/utils/ignore-vite-temp-files.d.ts.map +1 -0
  134. package/src/utils/ignore-vite-temp-files.js +22 -32
  135. package/src/utils/nx-tsconfig-paths-find-file.d.ts +1 -0
  136. package/src/utils/nx-tsconfig-paths-find-file.d.ts.map +1 -0
  137. package/src/utils/nx-tsconfig-paths-find-file.js +10 -16
  138. package/src/utils/options-utils.d.ts +1 -0
  139. package/src/utils/options-utils.d.ts.map +1 -0
  140. package/src/utils/options-utils.js +48 -58
  141. package/src/utils/test-files/test-vite-configs.d.ts +1 -0
  142. package/src/utils/test-files/test-vite-configs.d.ts.map +1 -0
  143. package/src/utils/test-files/test-vite-configs.js +21 -82
  144. package/src/utils/test-utils.d.ts +1 -0
  145. package/src/utils/test-utils.d.ts.map +1 -0
  146. package/src/utils/test-utils.js +103 -130
  147. package/src/utils/version-utils.d.ts +1 -0
  148. package/src/utils/version-utils.d.ts.map +1 -0
  149. package/src/utils/version-utils.js +26 -44
  150. package/src/utils/versions.d.ts +1 -0
  151. package/src/utils/versions.d.ts.map +1 -0
  152. package/src/utils/versions.js +22 -82
  153. package/src/utils/vite-config-edit-utils.d.ts +1 -0
  154. package/src/utils/vite-config-edit-utils.d.ts.map +1 -0
  155. package/src/utils/vite-config-edit-utils.js +145 -125
  156. package/executors.js.map +0 -1
  157. package/index.js.map +0 -1
  158. package/plugin.js.map +0 -1
  159. package/plugins/nx-copy-assets.plugin.js.map +0 -1
  160. package/plugins/nx-tsconfig-paths.plugin.js.map +0 -1
  161. package/plugins/nx-vite-build-coordination.plugin.js.map +0 -1
  162. package/plugins/rollup-replace-files.plugin.js.map +0 -1
  163. package/src/executors/build/build.impl.js.map +0 -1
  164. package/src/executors/build/compat.js.map +0 -1
  165. package/src/executors/build/schema.d.js +0 -3
  166. package/src/executors/build/schema.d.js.map +0 -1
  167. package/src/executors/dev-server/compat.js.map +0 -1
  168. package/src/executors/dev-server/dev-server.impl.js.map +0 -1
  169. package/src/executors/dev-server/schema.d.js +0 -3
  170. package/src/executors/dev-server/schema.d.js.map +0 -1
  171. package/src/executors/preview-server/compat.js.map +0 -1
  172. package/src/executors/preview-server/preview-server.impl.js.map +0 -1
  173. package/src/executors/preview-server/schema.d.js +0 -3
  174. package/src/executors/preview-server/schema.d.js.map +0 -1
  175. package/src/executors/test/compat.js.map +0 -1
  176. package/src/executors/test/lib/nx-reporter.js.map +0 -1
  177. package/src/executors/test/lib/utils.js.map +0 -1
  178. package/src/executors/test/schema.d.js +0 -3
  179. package/src/executors/test/schema.d.js.map +0 -1
  180. package/src/executors/test/vitest.impl.js.map +0 -1
  181. package/src/generators/configuration/configuration.js.map +0 -1
  182. package/src/generators/configuration/lib/convert-non-vite.js.map +0 -1
  183. package/src/generators/configuration/schema.d.js +0 -3
  184. package/src/generators/configuration/schema.d.js.map +0 -1
  185. package/src/generators/convert-to-inferred/convert-to-inferred.js.map +0 -1
  186. package/src/generators/convert-to-inferred/lib/build-post-target-transformer.js.map +0 -1
  187. package/src/generators/convert-to-inferred/lib/preview-post-target-transformer.js.map +0 -1
  188. package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.js.map +0 -1
  189. package/src/generators/convert-to-inferred/lib/test-post-target-transformer.js.map +0 -1
  190. package/src/generators/convert-to-inferred/lib/utils.js.map +0 -1
  191. package/src/generators/init/init.js.map +0 -1
  192. package/src/generators/init/lib/utils.js.map +0 -1
  193. package/src/generators/init/schema.d.js +0 -3
  194. package/src/generators/init/schema.d.js.map +0 -1
  195. package/src/generators/setup-paths-plugin/lib/utils.js.map +0 -1
  196. package/src/generators/setup-paths-plugin/schema.d.js +0 -3
  197. package/src/generators/setup-paths-plugin/schema.d.js.map +0 -1
  198. package/src/generators/setup-paths-plugin/setup-paths-plugin.js.map +0 -1
  199. package/src/generators/vitest/schema.d.js +0 -3
  200. package/src/generators/vitest/schema.d.js.map +0 -1
  201. package/src/generators/vitest/vitest-generator.js.map +0 -1
  202. package/src/migrations/update-19-6-0/add-depends-on-for-preview.js.map +0 -1
  203. package/src/migrations/update-20-0-4/add-vite-temp-files-to-git-ignore.js.map +0 -1
  204. package/src/migrations/update-20-3-0/add-vitest-temp-files-to-git-ignore.js.map +0 -1
  205. package/src/migrations/update-20-5-0/eslint-ignore-vite-temp-files.js.map +0 -1
  206. package/src/migrations/update-20-5-0/install-jiti.js.map +0 -1
  207. package/src/migrations/update-20-5-0/update-resolve-conditions.js.map +0 -1
  208. package/src/plugins/plugin.js.map +0 -1
  209. package/src/utils/detect-ui-framework.js.map +0 -1
  210. package/src/utils/e2e-web-server-info-utils.js.map +0 -1
  211. package/src/utils/ensure-dependencies.js.map +0 -1
  212. package/src/utils/executor-utils.js.map +0 -1
  213. package/src/utils/find-vite-config.js.map +0 -1
  214. package/src/utils/generator-utils.js.map +0 -1
  215. package/src/utils/ignore-vite-temp-files.js.map +0 -1
  216. package/src/utils/nx-tsconfig-paths-find-file.js.map +0 -1
  217. package/src/utils/options-utils.js.map +0 -1
  218. package/src/utils/test-files/test-vite-configs.js.map +0 -1
  219. package/src/utils/test-utils.js.map +0 -1
  220. package/src/utils/version-utils.js.map +0 -1
  221. package/src/utils/versions.js.map +0 -1
  222. package/src/utils/vite-config-edit-utils.js.map +0 -1
@@ -1,30 +1,28 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "ensureViteConfigIsCorrect", {
3
- enumerable: true,
4
- get: function() {
5
- return ensureViteConfigIsCorrect;
6
- }
7
- });
8
- const _devkit = require("@nx/devkit");
9
- const _js = require("@nx/js");
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ensureViteConfigIsCorrect = ensureViteConfigIsCorrect;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const js_1 = require("@nx/js");
10
6
  function ensureViteConfigIsCorrect(tree, path, buildConfigString, buildConfigObject, imports, plugins, testConfigString, testConfigObject, cacheDir, projectAlreadyHasViteTargets) {
11
7
  const fileContent = tree.read(path, 'utf-8');
12
8
  let updatedContent = undefined;
13
- if (!(projectAlreadyHasViteTargets == null ? void 0 : projectAlreadyHasViteTargets.test) && (testConfigString == null ? void 0 : testConfigString.length)) {
9
+ if (!projectAlreadyHasViteTargets?.test && testConfigString?.length) {
14
10
  updatedContent = handleBuildOrTestNode(fileContent, testConfigString, testConfigObject, 'test');
15
11
  }
16
- if (!(projectAlreadyHasViteTargets == null ? void 0 : projectAlreadyHasViteTargets.build) && (buildConfigString == null ? void 0 : buildConfigString.length)) {
17
- updatedContent = handleBuildOrTestNode(updatedContent != null ? updatedContent : fileContent, buildConfigString, buildConfigObject, 'build');
12
+ if (!projectAlreadyHasViteTargets?.build && buildConfigString?.length) {
13
+ updatedContent = handleBuildOrTestNode(updatedContent ?? fileContent, buildConfigString, buildConfigObject, 'build');
18
14
  }
19
- var _handlePluginNode;
20
- updatedContent = (_handlePluginNode = handlePluginNode(updatedContent != null ? updatedContent : fileContent, imports, plugins)) != null ? _handlePluginNode : updatedContent;
21
- if (cacheDir == null ? void 0 : cacheDir.length) {
22
- updatedContent = handleCacheDirNode(updatedContent != null ? updatedContent : fileContent, cacheDir);
15
+ updatedContent =
16
+ handlePluginNode(updatedContent ?? fileContent, imports, plugins) ??
17
+ updatedContent;
18
+ if (cacheDir?.length) {
19
+ updatedContent = handleCacheDirNode(updatedContent ?? fileContent, cacheDir);
23
20
  }
24
21
  if (updatedContent) {
25
22
  tree.write(path, updatedContent);
26
23
  return true;
27
- } else {
24
+ }
25
+ else {
28
26
  return false;
29
27
  }
30
28
  }
@@ -32,124 +30,140 @@ function handleBuildOrTestNode(updatedFileContent, configContentString, configCo
32
30
  const { tsquery } = require('@phenomnomnominal/tsquery');
33
31
  const buildOrTestNode = tsquery.query(updatedFileContent, `PropertyAssignment:has(Identifier[name="${name}"])`);
34
32
  if (buildOrTestNode.length) {
35
- return tsquery.replace(updatedFileContent, `PropertyAssignment:has(Identifier[name="${name}"])`, (node)=>{
33
+ return tsquery.replace(updatedFileContent, `PropertyAssignment:has(Identifier[name="${name}"])`, (node) => {
36
34
  const existingProperties = tsquery.query(node.initializer, 'PropertyAssignment');
37
35
  let updatedPropsString = '';
38
- for (const prop of existingProperties){
36
+ for (const prop of existingProperties) {
39
37
  const propName = prop.name.getText();
40
- if (!configContentObject[propName] && propName !== 'dir' && propName !== 'reportsDirectory' && propName !== 'provider') {
38
+ if (!configContentObject[propName] &&
39
+ propName !== 'dir' &&
40
+ propName !== 'reportsDirectory' &&
41
+ propName !== 'provider') {
41
42
  // NOTE: Watch for formatting.
42
43
  updatedPropsString += ` '${propName}': ${prop.initializer.getText()},\n`;
43
44
  }
44
45
  }
45
- for (const [propName, propValue] of Object.entries(configContentObject)){
46
+ for (const [propName, propValue] of Object.entries(configContentObject)) {
46
47
  // NOTE: Watch for formatting.
47
48
  if (propName === 'coverage') {
48
49
  let propString = ` '${propName}': {\n`;
49
- for (const [pName, pValue] of Object.entries(propValue)){
50
+ for (const [pName, pValue] of Object.entries(propValue)) {
50
51
  if (pName === 'provider') {
51
52
  propString += ` '${pName}': ${pValue} as const,\n`;
52
- } else {
53
+ }
54
+ else {
53
55
  propString += ` '${pName}': '${pValue}',\n`;
54
56
  }
55
57
  }
56
58
  propString += `}`;
57
59
  updatedPropsString += `${propString}\n`;
58
- } else if (propName === 'lib') {
60
+ }
61
+ else if (propName === 'lib') {
59
62
  let propString = ` '${propName}': {\n`;
60
- for (const [pName, pValue] of Object.entries(propValue)){
63
+ for (const [pName, pValue] of Object.entries(propValue)) {
61
64
  if (pName === 'formats') {
62
- propString += ` '${pName}': [${pValue.map((format)=>`'${format}' as const`).join(', ')}],\n`;
63
- } else {
65
+ propString += ` '${pName}': [${pValue
66
+ .map((format) => `'${format}' as const`)
67
+ .join(', ')}],\n`;
68
+ }
69
+ else {
64
70
  propString += ` '${pName}': ${JSON.stringify(pValue)},\n`;
65
71
  }
66
72
  }
67
73
  propString += ` },`;
68
74
  updatedPropsString += `${propString}\n`;
69
- } else {
75
+ }
76
+ else {
70
77
  updatedPropsString += ` '${propName}': ${JSON.stringify(propValue)},\n`;
71
78
  }
72
79
  }
73
80
  return `${name}: {
74
81
  ${updatedPropsString} }`;
75
82
  });
76
- } else {
83
+ }
84
+ else {
77
85
  const foundDefineConfig = tsquery.query(updatedFileContent, 'CallExpression:has(Identifier[name="defineConfig"])');
78
86
  if (foundDefineConfig.length) {
79
87
  const conditionalConfig = tsquery.query(foundDefineConfig[0], 'ArrowFunction');
80
88
  if (conditionalConfig.length) {
81
89
  if (name === 'build') {
82
90
  return transformConditionalConfig(conditionalConfig, updatedFileContent, configContentString);
83
- } else {
91
+ }
92
+ else {
84
93
  // no test config in conditional config
85
94
  return updatedFileContent;
86
95
  }
87
- } else {
96
+ }
97
+ else {
88
98
  const propertyAssignments = tsquery.query(foundDefineConfig[0], 'PropertyAssignment');
89
99
  if (propertyAssignments.length) {
90
- return (0, _devkit.applyChangesToString)(updatedFileContent, [
100
+ return (0, devkit_1.applyChangesToString)(updatedFileContent, [
91
101
  {
92
- type: _devkit.ChangeType.Insert,
102
+ type: devkit_1.ChangeType.Insert,
93
103
  index: propertyAssignments[0].getStart(),
94
- text: configContentString
95
- }
104
+ text: configContentString,
105
+ },
96
106
  ]);
97
- } else {
98
- return (0, _devkit.applyChangesToString)(updatedFileContent, [
107
+ }
108
+ else {
109
+ return (0, devkit_1.applyChangesToString)(updatedFileContent, [
99
110
  {
100
- type: _devkit.ChangeType.Insert,
111
+ type: devkit_1.ChangeType.Insert,
101
112
  index: foundDefineConfig[0].getStart() + 14,
102
- text: configContentString
103
- }
113
+ text: configContentString,
114
+ },
104
115
  ]);
105
116
  }
106
117
  }
107
- } else {
118
+ }
119
+ else {
108
120
  // build config does not exist and defineConfig is not used
109
121
  // could also potentially be invalid syntax, so try-catch
110
122
  try {
111
123
  const defaultExport = tsquery.query(updatedFileContent, 'ExportAssignment');
112
- const found = tsquery.query(defaultExport == null ? void 0 : defaultExport[0], 'ObjectLiteralExpression');
113
- const startOfObject = found == null ? void 0 : found[0].getStart();
114
- return (0, _devkit.applyChangesToString)(updatedFileContent, [
124
+ const found = tsquery.query(defaultExport?.[0], 'ObjectLiteralExpression');
125
+ const startOfObject = found?.[0].getStart();
126
+ return (0, devkit_1.applyChangesToString)(updatedFileContent, [
115
127
  {
116
- type: _devkit.ChangeType.Insert,
128
+ type: devkit_1.ChangeType.Insert,
117
129
  index: startOfObject + 1,
118
- text: configContentString
119
- }
130
+ text: configContentString,
131
+ },
120
132
  ]);
121
- } catch (e) {
133
+ }
134
+ catch {
122
135
  return updatedFileContent;
123
136
  }
124
137
  }
125
138
  }
126
139
  }
127
140
  function transformCurrentBuildObject(index, returnStatements, appFileContent, buildConfigObject) {
128
- var _tsquery_query;
129
- if (!(returnStatements == null ? void 0 : returnStatements[index])) {
141
+ if (!returnStatements?.[index]) {
130
142
  return undefined;
131
143
  }
132
144
  const { tsquery } = require('@phenomnomnominal/tsquery');
133
- const currentBuildObject = (_tsquery_query = tsquery.query(returnStatements[index], 'ObjectLiteralExpression')) == null ? void 0 : _tsquery_query[0].getText();
145
+ const currentBuildObject = tsquery
146
+ .query(returnStatements[index], 'ObjectLiteralExpression')?.[0]
147
+ .getText();
134
148
  const currentBuildObjectStart = returnStatements[index].getStart();
135
149
  const currentBuildObjectEnd = returnStatements[index].getEnd();
136
- const newReturnObject = tsquery.replace(returnStatements[index].getText(), 'ObjectLiteralExpression', (_node)=>{
150
+ const newReturnObject = tsquery.replace(returnStatements[index].getText(), 'ObjectLiteralExpression', (_node) => {
137
151
  return `{
138
152
  ...${currentBuildObject},
139
153
  ...${JSON.stringify(buildConfigObject)}
140
154
  }`;
141
155
  });
142
- const newContents = (0, _devkit.applyChangesToString)(appFileContent, [
156
+ const newContents = (0, devkit_1.applyChangesToString)(appFileContent, [
143
157
  {
144
- type: _devkit.ChangeType.Delete,
158
+ type: devkit_1.ChangeType.Delete,
145
159
  start: currentBuildObjectStart,
146
- length: currentBuildObjectEnd - currentBuildObjectStart
160
+ length: currentBuildObjectEnd - currentBuildObjectStart,
147
161
  },
148
162
  {
149
- type: _devkit.ChangeType.Insert,
163
+ type: devkit_1.ChangeType.Insert,
150
164
  index: currentBuildObjectStart,
151
- text: newReturnObject
152
- }
165
+ text: newReturnObject,
166
+ },
153
167
  ]);
154
168
  return newContents;
155
169
  }
@@ -157,40 +171,40 @@ function transformConditionalConfig(conditionalConfig, appFileContent, buildConf
157
171
  const { tsquery } = require('@phenomnomnominal/tsquery');
158
172
  const { SyntaxKind } = require('typescript');
159
173
  const functionBlock = tsquery.query(conditionalConfig[0], 'Block');
160
- const ifStatement = tsquery.query(functionBlock == null ? void 0 : functionBlock[0], 'IfStatement');
161
- const binaryExpressions = tsquery.query(ifStatement == null ? void 0 : ifStatement[0], 'BinaryExpression');
162
- const buildExists = binaryExpressions == null ? void 0 : binaryExpressions.find((binaryExpression)=>binaryExpression.getText() === `command === 'build'`);
163
- const buildExistsExpressionIndex = binaryExpressions == null ? void 0 : binaryExpressions.findIndex((binaryExpression)=>binaryExpression.getText() === `command === 'build'`);
164
- const serveExists = binaryExpressions == null ? void 0 : binaryExpressions.find((binaryExpression)=>binaryExpression.getText() === `command === 'serve'`);
165
- const elseKeywordExists = (0, _js.findNodes)(ifStatement == null ? void 0 : ifStatement[0], SyntaxKind.ElseKeyword);
174
+ const ifStatement = tsquery.query(functionBlock?.[0], 'IfStatement');
175
+ const binaryExpressions = tsquery.query(ifStatement?.[0], 'BinaryExpression');
176
+ const buildExists = binaryExpressions?.find((binaryExpression) => binaryExpression.getText() === `command === 'build'`);
177
+ const buildExistsExpressionIndex = binaryExpressions?.findIndex((binaryExpression) => binaryExpression.getText() === `command === 'build'`);
178
+ const serveExists = binaryExpressions?.find((binaryExpression) => binaryExpression.getText() === `command === 'serve'`);
179
+ const elseKeywordExists = (0, js_1.findNodes)(ifStatement?.[0], SyntaxKind.ElseKeyword);
166
180
  const returnStatements = tsquery.query(ifStatement[0], 'ReturnStatement');
167
181
  if (!buildExists) {
168
182
  if (serveExists && elseKeywordExists) {
169
- var _transformCurrentBuildObject;
170
183
  // build options live inside the else block
171
- return (_transformCurrentBuildObject = transformCurrentBuildObject((returnStatements == null ? void 0 : returnStatements.length) - 1, returnStatements, appFileContent, buildConfigObject)) != null ? _transformCurrentBuildObject : appFileContent;
172
- } else {
184
+ return (transformCurrentBuildObject(returnStatements?.length - 1, returnStatements, appFileContent, buildConfigObject) ?? appFileContent);
185
+ }
186
+ else {
173
187
  // no build options exist yet
174
- const functionBlockStart = functionBlock == null ? void 0 : functionBlock[0].getStart();
175
- const newContents = (0, _devkit.applyChangesToString)(appFileContent, [
188
+ const functionBlockStart = functionBlock?.[0].getStart();
189
+ const newContents = (0, devkit_1.applyChangesToString)(appFileContent, [
176
190
  {
177
- type: _devkit.ChangeType.Insert,
191
+ type: devkit_1.ChangeType.Insert,
178
192
  index: functionBlockStart + 1,
179
193
  text: `
180
194
  if (command === 'build') {
181
195
  return ${JSON.stringify(buildConfigObject)}
182
196
  }
183
- `
184
- }
197
+ `,
198
+ },
185
199
  ]);
186
200
  return newContents;
187
201
  }
188
- } else {
189
- var _transformCurrentBuildObject1;
202
+ }
203
+ else {
190
204
  // build already exists
191
205
  // it will be the return statement which lives
192
206
  // at the buildExistsExpressionIndex
193
- return (_transformCurrentBuildObject1 = transformCurrentBuildObject(buildExistsExpressionIndex, returnStatements, appFileContent, buildConfigObject)) != null ? _transformCurrentBuildObject1 : appFileContent;
207
+ return (transformCurrentBuildObject(buildExistsExpressionIndex, returnStatements, appFileContent, buildConfigObject) ?? appFileContent);
194
208
  }
195
209
  }
196
210
  function handlePluginNode(appFileContent, imports, plugins) {
@@ -199,23 +213,23 @@ function handlePluginNode(appFileContent, imports, plugins) {
199
213
  const pluginsNode = tsquery.query(file, 'PropertyAssignment:has(Identifier[name="plugins"])');
200
214
  let writeFile = false;
201
215
  if (pluginsNode.length) {
202
- appFileContent = tsquery.replace(file.getText(), 'PropertyAssignment:has(Identifier[name="plugins"])', (node)=>{
216
+ appFileContent = tsquery.replace(file.getText(), 'PropertyAssignment:has(Identifier[name="plugins"])', (node) => {
203
217
  const found = tsquery.query(node, 'ArrayLiteralExpression');
204
218
  let updatedPluginsString = '';
205
- var _found__elements;
206
- const existingPluginNodes = (_found__elements = found == null ? void 0 : found[0].elements) != null ? _found__elements : [];
207
- for (const plugin of existingPluginNodes){
219
+ const existingPluginNodes = found?.[0].elements ?? [];
220
+ for (const plugin of existingPluginNodes) {
208
221
  updatedPluginsString += `${plugin.getText()}, `;
209
222
  }
210
- for (const plugin of plugins){
211
- if (!(existingPluginNodes == null ? void 0 : existingPluginNodes.some((node)=>node.getText().includes(plugin)))) {
223
+ for (const plugin of plugins) {
224
+ if (!existingPluginNodes?.some((node) => node.getText().includes(plugin))) {
212
225
  updatedPluginsString += `${plugin}, `;
213
226
  }
214
227
  }
215
228
  return `plugins: [${updatedPluginsString}]`;
216
229
  });
217
230
  writeFile = true;
218
- } else {
231
+ }
232
+ else {
219
233
  // Plugins node does not exist yet
220
234
  // So make one from scratch
221
235
  const foundDefineConfig = tsquery.query(file, 'CallExpression:has(Identifier[name="defineConfig"])');
@@ -225,44 +239,48 @@ function handlePluginNode(appFileContent, imports, plugins) {
225
239
  // We are NOT transforming the conditional config
226
240
  // with plugins
227
241
  writeFile = false;
228
- } else {
242
+ }
243
+ else {
229
244
  const propertyAssignments = tsquery.query(foundDefineConfig[0], 'PropertyAssignment');
230
245
  if (propertyAssignments.length) {
231
- appFileContent = (0, _devkit.applyChangesToString)(appFileContent, [
246
+ appFileContent = (0, devkit_1.applyChangesToString)(appFileContent, [
232
247
  {
233
- type: _devkit.ChangeType.Insert,
248
+ type: devkit_1.ChangeType.Insert,
234
249
  index: propertyAssignments[0].getStart(),
235
- text: `plugins: [${plugins.join(', ')}],`
236
- }
250
+ text: `plugins: [${plugins.join(', ')}],`,
251
+ },
237
252
  ]);
238
253
  writeFile = true;
239
- } else {
240
- appFileContent = (0, _devkit.applyChangesToString)(appFileContent, [
254
+ }
255
+ else {
256
+ appFileContent = (0, devkit_1.applyChangesToString)(appFileContent, [
241
257
  {
242
- type: _devkit.ChangeType.Insert,
258
+ type: devkit_1.ChangeType.Insert,
243
259
  index: foundDefineConfig[0].getStart() + 14,
244
- text: `plugins: [${plugins.join(', ')}],`
245
- }
260
+ text: `plugins: [${plugins.join(', ')}],`,
261
+ },
246
262
  ]);
247
263
  writeFile = true;
248
264
  }
249
265
  }
250
- } else {
266
+ }
267
+ else {
251
268
  // Plugins option does not exist and defineConfig is not used
252
269
  // could also potentially be invalid syntax, so try-catch
253
270
  try {
254
271
  const defaultExport = tsquery.query(file, 'ExportAssignment');
255
- const found = tsquery == null ? void 0 : tsquery.query(defaultExport == null ? void 0 : defaultExport[0], 'ObjectLiteralExpression');
256
- const startOfObject = found == null ? void 0 : found[0].getStart();
257
- appFileContent = (0, _devkit.applyChangesToString)(appFileContent, [
272
+ const found = tsquery?.query(defaultExport?.[0], 'ObjectLiteralExpression');
273
+ const startOfObject = found?.[0].getStart();
274
+ appFileContent = (0, devkit_1.applyChangesToString)(appFileContent, [
258
275
  {
259
- type: _devkit.ChangeType.Insert,
276
+ type: devkit_1.ChangeType.Insert,
260
277
  index: startOfObject + 1,
261
- text: `plugins: [${plugins.join(', ')}],`
262
- }
278
+ text: `plugins: [${plugins.join(', ')}],`,
279
+ },
263
280
  ]);
264
281
  writeFile = true;
265
- } catch (e) {
282
+ }
283
+ catch {
266
284
  writeFile = false;
267
285
  }
268
286
  }
@@ -276,64 +294,66 @@ function filterImport(appFileContent, imports) {
276
294
  const { tsquery } = require('@phenomnomnominal/tsquery');
277
295
  const file = tsquery.ast(appFileContent);
278
296
  const importNodes = tsquery.query(file, ':matches(ImportDeclaration, VariableStatement)');
279
- const importsArrayExisting = importNodes == null ? void 0 : importNodes.map((node)=>{
297
+ const importsArrayExisting = importNodes?.map((node) => {
280
298
  return node.getText().slice(0, -1);
281
299
  });
282
- return imports.filter((importString)=>{
283
- return !(importsArrayExisting == null ? void 0 : importsArrayExisting.includes(importString));
300
+ return imports.filter((importString) => {
301
+ return !importsArrayExisting?.includes(importString);
284
302
  });
285
303
  }
286
304
  function handleCacheDirNode(appFileContent, cacheDir) {
287
305
  const { tsquery } = require('@phenomnomnominal/tsquery');
288
306
  const file = tsquery.ast(appFileContent);
289
307
  const cacheDirNode = tsquery.query(file, 'PropertyAssignment:has(Identifier[name="cacheDir"])');
290
- if (!(cacheDirNode == null ? void 0 : cacheDirNode.length) || (cacheDirNode == null ? void 0 : cacheDirNode.length) === 0) {
308
+ if (!cacheDirNode?.length || cacheDirNode?.length === 0) {
291
309
  // cacheDir node does not exist yet
292
310
  // So make one from scratch
293
311
  const foundDefineConfig = tsquery.query(file, 'CallExpression:has(Identifier[name="defineConfig"])');
294
312
  if (foundDefineConfig.length) {
295
313
  const conditionalConfig = tsquery.query(foundDefineConfig[0], 'ArrowFunction');
296
314
  if (conditionalConfig.length) {
297
- // We are NOT transforming the conditional config
298
- // with cacheDir
299
- } else {
315
+ // We are NOT transforming the conditional config
316
+ // with cacheDir
317
+ }
318
+ else {
300
319
  const propertyAssignments = tsquery.query(foundDefineConfig[0], 'PropertyAssignment');
301
320
  if (propertyAssignments.length) {
302
- appFileContent = (0, _devkit.applyChangesToString)(appFileContent, [
321
+ appFileContent = (0, devkit_1.applyChangesToString)(appFileContent, [
303
322
  {
304
- type: _devkit.ChangeType.Insert,
323
+ type: devkit_1.ChangeType.Insert,
305
324
  index: propertyAssignments[0].getStart(),
306
- text: cacheDir
307
- }
325
+ text: cacheDir,
326
+ },
308
327
  ]);
309
- } else {
310
- appFileContent = (0, _devkit.applyChangesToString)(appFileContent, [
328
+ }
329
+ else {
330
+ appFileContent = (0, devkit_1.applyChangesToString)(appFileContent, [
311
331
  {
312
- type: _devkit.ChangeType.Insert,
332
+ type: devkit_1.ChangeType.Insert,
313
333
  index: foundDefineConfig[0].getStart() + 14,
314
- text: cacheDir
315
- }
334
+ text: cacheDir,
335
+ },
316
336
  ]);
317
337
  }
318
338
  }
319
- } else {
339
+ }
340
+ else {
320
341
  // cacheDir option does not exist and defineConfig is not used
321
342
  // could also potentially be invalid syntax, so try-catch
322
343
  try {
323
344
  const defaultExport = tsquery.query(file, 'ExportAssignment');
324
- const found = tsquery == null ? void 0 : tsquery.query(defaultExport == null ? void 0 : defaultExport[0], 'ObjectLiteralExpression');
325
- const startOfObject = found == null ? void 0 : found[0].getStart();
326
- appFileContent = (0, _devkit.applyChangesToString)(appFileContent, [
345
+ const found = tsquery?.query(defaultExport?.[0], 'ObjectLiteralExpression');
346
+ const startOfObject = found?.[0].getStart();
347
+ appFileContent = (0, devkit_1.applyChangesToString)(appFileContent, [
327
348
  {
328
- type: _devkit.ChangeType.Insert,
349
+ type: devkit_1.ChangeType.Insert,
329
350
  index: startOfObject + 1,
330
- text: cacheDir
331
- }
351
+ text: cacheDir,
352
+ },
332
353
  ]);
333
- } catch (e) {}
354
+ }
355
+ catch { }
334
356
  }
335
357
  }
336
358
  return appFileContent;
337
359
  }
338
-
339
- //# sourceMappingURL=vite-config-edit-utils.js.map
package/executors.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/vite/executors.ts"],"sourcesContent":["export { type ViteBuildExecutorOptions } from './src/executors/build/schema';\nexport { viteBuildExecutor } from './src/executors/build/build.impl';\nexport { type ViteDevServerExecutorOptions } from './src/executors/dev-server/schema';\nexport { viteDevServerExecutor } from './src/executors/dev-server/dev-server.impl';\nexport { type VitePreviewServerExecutorOptions } from './src/executors/preview-server/schema';\nexport { vitePreviewServerExecutor } from './src/executors/preview-server/preview-server.impl';\nexport { type VitestExecutorOptions } from './src/executors/test/schema';\nexport { vitestExecutor } from './src/executors/test/vitest.impl';\n"],"names":["viteBuildExecutor","viteDevServerExecutor","vitePreviewServerExecutor","vitestExecutor"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;IACSA,iBAAiB;eAAjBA,4BAAiB;;IAEjBC,qBAAqB;eAArBA,oCAAqB;;IAErBC,yBAAyB;eAAzBA,4CAAyB;;IAEzBC,cAAc;eAAdA,0BAAc;;;2BANW;+BAEI;mCAEI;4BAEX"}
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/vite/index.ts"],"sourcesContent":["export * from './src/utils/versions';\nexport * from './src/utils/generator-utils';\nexport * from './src/utils/e2e-web-server-info-utils';\nexport { type ViteConfigurationGeneratorSchema } from './src/generators/configuration/schema';\nexport { viteConfigurationGenerator } from './src/generators/configuration/configuration';\nexport { type VitestGeneratorSchema } from './src/generators/vitest/schema';\nexport { vitestGenerator } from './src/generators/vitest/vitest-generator';\nexport { type InitGeneratorSchema } from './src/generators/init/schema';\nexport { initGenerator } from './src/generators/init/init';\n"],"names":["initGenerator","viteConfigurationGenerator","vitestGenerator"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;IAQSA,aAAa;eAAbA,mBAAa;;IAJbC,0BAA0B;eAA1BA,yCAA0B;;IAE1BC,eAAe;eAAfA,gCAAe;;;;uBANV;uBACA;uBACA;+BAE6B;iCAEX;sBAEF"}
package/plugin.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/vite/plugin.ts"],"sourcesContent":["export {\n createNodes,\n createNodesV2,\n VitePluginOptions,\n createDependencies,\n} from './src/plugins/plugin';\n"],"names":["VitePluginOptions","createDependencies","createNodes","createNodesV2"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;IAGEA,iBAAiB;eAAjBA,yBAAiB;;IACjBC,kBAAkB;eAAlBA,0BAAkB;;IAHlBC,WAAW;eAAXA,mBAAW;;IACXC,aAAa;eAAbA,qBAAa;;;wBAGR"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../packages/vite/plugins/nx-copy-assets.plugin.ts"],"sourcesContent":["import { join, relative } from 'node:path';\nimport type { Plugin, ResolvedConfig } from 'vite';\nimport { isDaemonEnabled, joinPathFragments, workspaceRoot } from '@nx/devkit';\nimport { AssetGlob } from '@nx/js/src/utils/assets/assets';\nimport { CopyAssetsHandler } from '@nx/js/src/utils/assets/copy-assets-handler';\n\nexport function nxCopyAssetsPlugin(_assets: (string | AssetGlob)[]): Plugin {\n let config: ResolvedConfig;\n let handler: CopyAssetsHandler;\n let dispose: () => void;\n\n if (global.NX_GRAPH_CREATION) return;\n\n return {\n name: 'nx-copy-assets-plugin',\n configResolved(_config) {\n config = _config;\n },\n async buildStart() {\n const relativeProjectRoot = relative(workspaceRoot, config.root);\n const assets = _assets.map((a) => {\n if (typeof a === 'string') {\n return joinPathFragments(relativeProjectRoot, a);\n } else {\n return {\n ...a,\n input: joinPathFragments(relativeProjectRoot, a.input),\n };\n }\n });\n handler = new CopyAssetsHandler({\n rootDir: workspaceRoot,\n projectDir: config.root,\n outputDir: config.build.outDir.startsWith(config.root)\n ? config.build.outDir\n : join(config.root, config.build.outDir),\n assets,\n });\n if (this.meta.watchMode && isDaemonEnabled()) {\n dispose = await handler.watchAndProcessOnAssetChange();\n }\n },\n async writeBundle() {\n await handler.processAllAssetsOnce();\n },\n async closeWatcher() {\n dispose == null ? void 0 : dispose();\n },\n };\n}\n"],"names":["nxCopyAssetsPlugin","_assets","config","handler","dispose","global","NX_GRAPH_CREATION","name","configResolved","_config","buildStart","relativeProjectRoot","relative","workspaceRoot","root","assets","map","a","joinPathFragments","input","CopyAssetsHandler","rootDir","projectDir","outputDir","build","outDir","startsWith","join","meta","watchMode","isDaemonEnabled","watchAndProcessOnAssetChange","writeBundle","processAllAssetsOnce","closeWatcher"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";+BAMgBA;;;eAAAA;;;;0BANe;wBAEmC;mCAEhC;AAE3B,SAASA,mBAAmBC,OAA+B;IAChE,IAAIC;IACJ,IAAIC;IACJ,IAAIC;IAEJ,IAAIC,OAAOC,iBAAiB,EAAE;IAE9B,OAAO;QACLC,MAAM;QACNC,gBAAeC,OAAO;YACpBP,SAASO;QACX;QACA,MAAMC;YACJ,MAAMC,sBAAsBC,IAAAA,kBAAQ,EAACC,qBAAa,EAAEX,OAAOY,IAAI;YAC/D,MAAMC,SAASd,QAAQe,GAAG,CAAC,CAACC;gBAC1B,IAAI,OAAOA,MAAM,UAAU;oBACzB,OAAOC,IAAAA,yBAAiB,EAACP,qBAAqBM;gBAChD,OAAO;oBACL,OAAO,eACFA;wBACHE,OAAOD,IAAAA,yBAAiB,EAACP,qBAAqBM,EAAEE,KAAK;;gBAEzD;YACF;YACAhB,UAAU,IAAIiB,oCAAiB,CAAC;gBAC9BC,SAASR,qBAAa;gBACtBS,YAAYpB,OAAOY,IAAI;gBACvBS,WAAWrB,OAAOsB,KAAK,CAACC,MAAM,CAACC,UAAU,CAACxB,OAAOY,IAAI,IACjDZ,OAAOsB,KAAK,CAACC,MAAM,GACnBE,IAAAA,cAAI,EAACzB,OAAOY,IAAI,EAAEZ,OAAOsB,KAAK,CAACC,MAAM;gBACzCV;YACF;YACA,IAAI,IAAI,CAACa,IAAI,CAACC,SAAS,IAAIC,IAAAA,uBAAe,KAAI;gBAC5C1B,UAAU,MAAMD,QAAQ4B,4BAA4B;YACtD;QACF;QACA,MAAMC;YACJ,MAAM7B,QAAQ8B,oBAAoB;QACpC;QACA,MAAMC;YACJ9B,WAAW,OAAO,KAAK,IAAIA;QAC7B;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../packages/vite/plugins/nx-tsconfig-paths.plugin.ts"],"sourcesContent":["import {\n createProjectGraphAsync,\n joinPathFragments,\n stripIndents,\n workspaceRoot,\n} from '@nx/devkit';\nimport { copyFileSync, existsSync } from 'node:fs';\nimport { join, relative, resolve } from 'node:path';\nimport {\n loadConfig,\n createMatchPath,\n MatchPath,\n ConfigLoaderSuccessResult,\n} from 'tsconfig-paths';\nimport {\n calculateProjectBuildableDependencies,\n createTmpTsConfig,\n} from '@nx/js/src/utils/buildable-libs-utils';\nimport { Plugin } from 'vite';\nimport { nxViteBuildCoordinationPlugin } from './nx-vite-build-coordination.plugin';\nimport { findFile } from '../src/utils/nx-tsconfig-paths-find-file';\nimport { isUsingTsSolutionSetup } from '@nx/js/src/utils/typescript/ts-solution-setup';\nimport { getProjectTsConfigPath } from '../src/utils/options-utils';\n\nexport interface nxViteTsPathsOptions {\n /**\n * Enable debug logging\n * If set to false, it will always ignore the debug logging even when `--verbose` or `NX_VERBOSE_LOGGING` is set to true.\n * @default undefined\n **/\n debug?: boolean;\n /**\n * export fields in package.json to use for resolving\n * @default [['exports', '.', 'import'], 'module', 'main']\n *\n * fallback resolution will use ['main', 'module']\n **/\n mainFields?: (string | string[])[];\n /**\n * extensions to check when resolving files when package.json resolution fails\n * @default ['.ts', '.tsx', '.js', '.jsx', '.json', '.mjs', '.cjs']\n **/\n extensions?: string[];\n /**\n * Inform Nx whether to use the raw source or to use the built output for buildable dependencies.\n * Set to `false` to use incremental builds.\n * @default true\n */\n buildLibsFromSource?: boolean;\n}\n\nexport function nxViteTsPaths(options: nxViteTsPathsOptions = {}) {\n let foundTsConfigPath: string;\n let matchTsPathEsm: MatchPath;\n let matchTsPathFallback: MatchPath | undefined;\n let tsConfigPathsEsm: ConfigLoaderSuccessResult;\n let tsConfigPathsFallback: ConfigLoaderSuccessResult;\n\n options.extensions ??= [\n '.ts',\n '.tsx',\n '.js',\n '.jsx',\n '.json',\n '.mts',\n '.mjs',\n '.cts',\n '.cjs',\n '.css',\n '.scss',\n '.less',\n ];\n options.mainFields ??= [['exports', '.', 'import'], 'module', 'main'];\n options.buildLibsFromSource ??= true;\n let projectRoot = '';\n\n return {\n name: 'nx-vite-ts-paths',\n // Ensure the resolveId aspect of the plugin is called before vite's internal resolver\n // Otherwise, issues can arise with Yarn Workspaces and Pnpm Workspaces\n enforce: 'pre',\n async configResolved(config: any) {\n projectRoot = config.root;\n const projectRootFromWorkspaceRoot = relative(workspaceRoot, projectRoot);\n foundTsConfigPath = getTsConfig(\n process.env.NX_TSCONFIG_PATH ??\n join(\n workspaceRoot,\n 'tmp',\n projectRootFromWorkspaceRoot,\n process.env.NX_TASK_TARGET_TARGET ?? 'build',\n 'tsconfig.generated.json'\n )\n );\n\n if (!foundTsConfigPath) return;\n\n if (\n !options.buildLibsFromSource &&\n !global.NX_GRAPH_CREATION &&\n config.mode !== 'test'\n ) {\n const projectGraph = await createProjectGraphAsync({\n exitOnError: false,\n resetDaemonClient: true,\n });\n // When using incremental building and the serve target is called\n // we need to get the deps for the 'build' target instead.\n const depsBuildTarget =\n process.env.NX_TASK_TARGET_TARGET === 'serve'\n ? 'build'\n : process.env.NX_TASK_TARGET_TARGET;\n const { dependencies } = calculateProjectBuildableDependencies(\n undefined,\n projectGraph,\n workspaceRoot,\n process.env.NX_TASK_TARGET_PROJECT,\n depsBuildTarget,\n process.env.NX_TASK_TARGET_CONFIGURATION\n );\n // This tsconfig is used via the Vite ts paths plugin.\n // It can be also used by other user-defined Vite plugins (e.g. for creating type declaration files).\n foundTsConfigPath = createTmpTsConfig(\n foundTsConfigPath,\n workspaceRoot,\n relative(workspaceRoot, projectRoot),\n dependencies,\n true\n );\n\n if (config.command === 'serve') {\n const buildableLibraryDependencies = dependencies\n .filter((dep) => dep.node.type === 'lib')\n .map((dep) => dep.node.name)\n .join(',');\n const buildCommand = `npx nx run-many --target=${depsBuildTarget} --projects=${buildableLibraryDependencies}`;\n config.plugins.push(nxViteBuildCoordinationPlugin({ buildCommand }));\n }\n }\n\n const parsed = loadConfig(foundTsConfigPath);\n\n logIt('first parsed tsconfig: ', parsed);\n if (parsed.resultType === 'failed') {\n throw new Error(`Failed loading tsconfig at ${foundTsConfigPath}`);\n }\n tsConfigPathsEsm = parsed;\n\n matchTsPathEsm = createMatchPath(\n parsed.absoluteBaseUrl,\n parsed.paths,\n options.mainFields\n );\n\n const rootLevelTsConfig = getTsConfig(\n join(workspaceRoot, 'tsconfig.base.json')\n );\n const rootLevelParsed = loadConfig(rootLevelTsConfig);\n logIt('fallback parsed tsconfig: ', rootLevelParsed);\n if (rootLevelParsed.resultType === 'success') {\n tsConfigPathsFallback = rootLevelParsed;\n matchTsPathFallback = createMatchPath(\n rootLevelParsed.absoluteBaseUrl,\n rootLevelParsed.paths,\n ['main', 'module']\n );\n }\n },\n resolveId(importPath: string) {\n // Let other resolvers handle this path.\n if (!foundTsConfigPath) return null;\n\n let resolvedFile: string;\n try {\n resolvedFile = matchTsPathEsm(importPath);\n } catch (e) {\n logIt('Using fallback path matching.');\n resolvedFile = matchTsPathFallback?.(importPath);\n }\n\n if (!resolvedFile || !existsSync(resolvedFile)) {\n if (tsConfigPathsEsm || tsConfigPathsFallback) {\n logIt(\n `Unable to resolve ${importPath} with tsconfig paths. Using fallback file matching.`\n );\n resolvedFile =\n loadFileFromPaths(tsConfigPathsEsm, importPath) ||\n loadFileFromPaths(tsConfigPathsFallback, importPath);\n } else {\n logIt(`Unable to resolve ${importPath} with tsconfig paths`);\n }\n }\n\n logIt(`Resolved ${importPath} to ${resolvedFile}`);\n // Returning null defers to other resolveId functions and eventually the default resolution behavior\n // https://rollupjs.org/plugin-development/#resolveid\n return resolvedFile || null;\n },\n async writeBundle(options) {\n if (isUsingTsSolutionSetup()) return;\n const outDir = options.dir || 'dist';\n const src = resolve(projectRoot, 'package.json');\n if (existsSync(src)) {\n const dest = join(outDir, 'package.json');\n\n try {\n copyFileSync(src, dest);\n } catch (err) {\n console.error('Error copying package.json:', err);\n }\n }\n },\n } as Plugin;\n\n function getTsConfig(preferredTsConfigPath: string): string {\n const projectTsConfigPath = getProjectTsConfigPath(projectRoot);\n return [\n resolve(preferredTsConfigPath),\n projectTsConfigPath ? resolve(projectTsConfigPath) : null,\n resolve(join(workspaceRoot, 'tsconfig.base.json')),\n resolve(join(workspaceRoot, 'tsconfig.json')),\n resolve(join(workspaceRoot, 'jsconfig.json')),\n ]\n .filter(Boolean)\n .find((tsPath) => {\n if (existsSync(tsPath)) {\n logIt('Found tsconfig at', tsPath);\n return tsPath;\n }\n });\n }\n\n function logIt(...msg: any[]) {\n if (process.env.NX_VERBOSE_LOGGING === 'true' && options?.debug !== false) {\n console.debug('\\n[Nx Vite TsPaths]', ...msg);\n }\n }\n\n function loadFileFromPaths(\n tsconfig: ConfigLoaderSuccessResult,\n importPath: string\n ) {\n logIt(\n `Trying to resolve file from config in ${tsconfig.configFileAbsolutePath}`\n );\n let resolvedFile: string;\n for (const alias in tsconfig.paths) {\n const paths = tsconfig.paths[alias];\n\n const normalizedImport = alias.replace(/\\/\\*$/, '');\n\n if (\n importPath === normalizedImport ||\n importPath.startsWith(normalizedImport + '/')\n ) {\n const joinedPath = joinPathFragments(\n tsconfig.absoluteBaseUrl,\n paths[0].replace(/\\/\\*$/, '')\n );\n\n resolvedFile = findFile(\n importPath.replace(normalizedImport, joinedPath),\n options.extensions\n );\n\n if (\n resolvedFile === undefined &&\n options.extensions.some((ext) => importPath.endsWith(ext))\n ) {\n const foundExtension = options.extensions.find((ext) =>\n importPath.endsWith(ext)\n );\n const pathWithoutExtension = importPath\n .replace(normalizedImport, joinedPath)\n .slice(0, -foundExtension.length);\n resolvedFile = findFile(pathWithoutExtension, options.extensions);\n }\n }\n }\n\n return resolvedFile;\n }\n}\n"],"names":["nxViteTsPaths","options","foundTsConfigPath","matchTsPathEsm","matchTsPathFallback","tsConfigPathsEsm","tsConfigPathsFallback","extensions","mainFields","buildLibsFromSource","projectRoot","name","enforce","configResolved","config","root","projectRootFromWorkspaceRoot","relative","workspaceRoot","process","getTsConfig","env","NX_TSCONFIG_PATH","join","NX_TASK_TARGET_TARGET","global","NX_GRAPH_CREATION","mode","projectGraph","createProjectGraphAsync","exitOnError","resetDaemonClient","depsBuildTarget","dependencies","calculateProjectBuildableDependencies","undefined","NX_TASK_TARGET_PROJECT","NX_TASK_TARGET_CONFIGURATION","createTmpTsConfig","command","buildableLibraryDependencies","filter","dep","node","type","map","buildCommand","plugins","push","nxViteBuildCoordinationPlugin","parsed","loadConfig","logIt","resultType","Error","createMatchPath","absoluteBaseUrl","paths","rootLevelTsConfig","rootLevelParsed","resolveId","importPath","resolvedFile","e","existsSync","loadFileFromPaths","writeBundle","isUsingTsSolutionSetup","outDir","dir","src","resolve","dest","copyFileSync","err","console","error","preferredTsConfigPath","projectTsConfigPath","getProjectTsConfigPath","Boolean","find","tsPath","msg","NX_VERBOSE_LOGGING","debug","tsconfig","configFileAbsolutePath","alias","normalizedImport","replace","startsWith","joinedPath","joinPathFragments","findFile","some","ext","endsWith","foundExtension","pathWithoutExtension","slice","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";+BAmDgBA;;;eAAAA;;;wBA9CT;wBACkC;0BACD;+BAMjC;oCAIA;+CAEuC;yCACrB;iCACc;8BACA;AA6BhC,SAASA,cAAcC,UAAgC,CAAC,CAAC;QAO9DA,UAcAA,WACAA;IArBA,IAAIC;IACJ,IAAIC;IACJ,IAAIC;IACJ,IAAIC;IACJ,IAAIC;;IAEJL,gBAAAA,WAAAA,SAAQM,oCAARN,SAAQM,aAAe;QACrB;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;;IACDN,gBAAAA,YAAAA,SAAQO,oCAARP,UAAQO,aAAe;QAAC;YAAC;YAAW;YAAK;SAAS;QAAE;QAAU;KAAO;;IACrEP,yBAAAA,YAAAA,SAAQQ,sDAARR,UAAQQ,sBAAwB;IAChC,IAAIC,cAAc;IAElB,OAAO;QACLC,MAAM;QACN,sFAA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,QAAmC,EACnCzB,UAAkB;QAElBT,MACE,CAAC,sCAAsC,EAAEkC,SAASC,sBAAsB,CAAC,CAAC;QAE5E,IAAIzB;QACJ,IAAK,MAAM0B,SAASF,SAAS7B,KAAK,CAAE;YAClC,MAAMA,QAAQ6B,SAAS7B,KAAK,CAAC+B,MAAM;YAEnC,MAAMC,mBAAmBD,MAAME,OAAO,CAAC,SAAS;YAEhD,IACE7B,eAAe4B,oBACf5B,WAAW8B,UAAU,CAACF,mBAAmB,MACzC;gBACA,MAAMG,aAAaC,IAAAA,yBAAiB,EAClCP,SAAS9B,eAAe,EACxBC,KAAK,CAAC,EAAE,CAACiC,OAAO,CAAC,SAAS;gBAG5B5B,eAAegC,IAAAA,iCAAQ,EACrBjC,WAAW6B,OAAO,CAACD,kBAAkBG,aACrC3F,QAAQM,UAAU;gBAGpB,IACEuD,iBAAiB3B,aACjBlC,QAAQM,UAAU,CAACwF,IAAI,CAAC,CAACC,MAAQnC,WAAWoC,QAAQ,CAACD,OACrD;oBACA,MAAME,iBAAiBjG,QAAQM,UAAU,CAAC0E,IAAI,CAAC,CAACe,MAC9CnC,WAAWoC,QAAQ,CAACD;oBAEtB,MAAMG,uBAAuBtC,WAC1B6B,OAAO,CAACD,kBAAkBG,YAC1BQ,KAAK,CAAC,GAAG,CAACF,eAAeG,MAAM;oBAClCvC,eAAegC,IAAAA,iCAAQ,EAACK,sBAAsBlG,QAAQM,UAAU;gBAClE;YACF;QACF;QAEA,OAAOuD;IACT;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../packages/vite/plugins/nx-vite-build-coordination.plugin.ts"],"sourcesContent":["import { type Plugin } from 'vite';\nimport { BatchFunctionRunner } from 'nx/src/command-line/watch/watch';\nimport { exec, type ChildProcess } from 'child_process';\nimport {\n daemonClient,\n type UnregisterCallback,\n} from 'nx/src/daemon/client/client';\nimport { output } from 'nx/src/utils/output';\n\nexport interface NxViteBuildCoordinationPluginOptions {\n buildCommand: string;\n}\nexport function nxViteBuildCoordinationPlugin(\n options: NxViteBuildCoordinationPluginOptions\n): Plugin {\n let activeBuildProcess: ChildProcess | undefined;\n let unregisterFileWatcher: UnregisterCallback | undefined;\n\n async function buildChangedProjects() {\n await new Promise<void>((res) => {\n activeBuildProcess = exec(options.buildCommand, {\n windowsHide: false,\n });\n activeBuildProcess.stdout.pipe(process.stdout);\n activeBuildProcess.stderr.pipe(process.stderr);\n activeBuildProcess.on('exit', () => {\n res();\n });\n activeBuildProcess.on('error', () => {\n res();\n });\n });\n activeBuildProcess = undefined;\n }\n\n function createFileWatcher() {\n const runner = new BatchFunctionRunner(() => buildChangedProjects());\n return daemonClient.registerFileWatcher(\n { watchProjects: 'all' },\n (err, { changedProjects, changedFiles }) => {\n if (err === 'closed') {\n output.error({\n title: 'Watch connection closed',\n bodyLines: [\n 'The daemon had closed the connection to this watch process.',\n 'Please restart your watch command.',\n ],\n });\n process.exit(1);\n }\n\n if (activeBuildProcess) {\n activeBuildProcess.kill(2);\n activeBuildProcess = undefined;\n }\n\n runner.enqueue(changedProjects, changedFiles);\n }\n );\n }\n\n let firstBuildStart = true;\n\n return {\n name: 'nx-vite-build-coordination-plugin',\n async buildStart() {\n if (firstBuildStart) {\n firstBuildStart = false;\n await buildChangedProjects();\n if (daemonClient.enabled()) {\n unregisterFileWatcher = await createFileWatcher();\n process.on('exit', () => unregisterFileWatcher());\n process.on('SIGINT', () => process.exit());\n } else {\n output.warn({\n title:\n 'Nx Daemon is not enabled. Projects will not be rebuilt when files change.',\n });\n }\n }\n },\n };\n}\n"],"names":["nxViteBuildCoordinationPlugin","options","activeBuildProcess","unregisterFileWatcher","buildChangedProjects","Promise","res","exec","buildCommand","windowsHide","stdout","pipe","process","stderr","on","undefined","createFileWatcher","runner","BatchFunctionRunner","daemonClient","registerFileWatcher","watchProjects","err","changedProjects","changedFiles","output","error","title","bodyLines","exit","kill","enqueue","firstBuildStart","name","buildStart","enabled","warn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;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AAU,IAAMF,QAAQiB,IAAI;gBACzC,OAAO;oBACLJ,cAAM,CAACW,IAAI,CAAC;wBACVT,OACE;oBACJ;gBACF;YACF;QACF;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../packages/vite/plugins/rollup-replace-files.plugin.ts"],"sourcesContent":["// source: https://github.com/Myrmod/vitejs-theming/blob/master/build-plugins/rollup/replace-files.js\n\n/**\n * @function replaceFiles\n * @param {FileReplacement[]} replacements\n * @return {({name: \"rollup-plugin-replace-files\", enforce: \"pre\" | \"post\" | undefined, Promise<resolveId>})}\n */\nexport function replaceFiles(replacements: FileReplacement[]): {\n name: string;\n enforce: 'pre' | 'post' | undefined;\n resolveId(\n source: any,\n importer: any,\n options: any\n ): Promise<{\n id: string;\n }>;\n} {\n if (!replacements?.length) {\n return null;\n }\n return {\n name: 'rollup-plugin-replace-files',\n enforce: 'pre',\n async resolveId(source, importer, options) {\n const resolved = await this.resolve(source, importer, {\n ...options,\n skipSelf: true,\n });\n /**\n * The reason we're using endsWith here is because the resolved id\n * will be the absolute path to the file. We want to check if the\n * file ends with the file we're trying to replace, which will be essentially\n * the path from the root of our workspace.\n */\n\n const foundReplace = replacements.find((replacement) =>\n resolved?.id?.endsWith(replacement.replace)\n );\n if (foundReplace) {\n console.info(\n `replace \"${foundReplace.replace}\" with \"${foundReplace.with}\"`\n );\n try {\n // return new file content\n return {\n id: foundReplace.with,\n };\n } catch (err) {\n console.error(err);\n return null;\n }\n }\n return null;\n },\n };\n}\n\nexport interface FileReplacement {\n replace: string;\n with: string;\n}\n"],"names":["replaceFiles","replacements","length","name","enforce","resolveId","source","importer","options","resolved","resolve","skipSelf","foundReplace","find","replacement","id","endsWith","replace","console","info","with","err","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,qGAAqG;AAErG;;;;CAIC;+BACeA;;;eAAAA;;;;AAAT,SAASA,aAAaC,YAA+B;IAW1D,IAAI,EAACA,gCAAAA,aAAcC,MAAM,GAAE;QACzB,OAAO;IACT;IACA,OAAO;QACLC,MAAM;QACNC,SAAS;QACT,MAAMC,WAAUC,MAAM,EAAEC,QAAQ,EAAEC,OAAO;YACvC,MAAMC,WAAW,MAAM,IAAI,CAACC,OAAO,CAACJ,QAAQC,UAAU,eACjDC;gBACHG,UAAU;;YAEZ;;;;;OAKC,GAED,MAAMC,eAAeX,aAAaY,IAAI,CAAC,CAACC;oBACtCL;uBAAAA,6BAAAA,eAAAA,SAAUM,EAAE,qBAAZN,aAAcO,QAAQ,CAACF,YAAYG,OAAO;;YAE5C,IAAIL,cAAc;gBAChBM,QAAQC,IAAI,CACV,CAAC,SAAS,EAAEP,aAAaK,OAAO,CAAC,QAAQ,EAAEL,aAAaQ,IAAI,CAAC,CAAC,CAAC;gBAEjE,IAAI;oBACF,0BAA0B;oBAC1B,OAAO;wBACLL,IAAIH,aAAaQ,IAAI;oBACvB;gBACF,EAAE,OAAOC,KAAK;oBACZH,QAAQI,KAAK,CAACD;oBACd,OAAO;gBACT;YACF;YACA,OAAO;QACT;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/vite/src/executors/build/build.impl.ts"],"sourcesContent":["import {\n detectPackageManager,\n ExecutorContext,\n joinPathFragments,\n logger,\n offsetFromRoot,\n stripIndents,\n writeJsonFile,\n} from '@nx/devkit';\nimport {\n getProjectTsConfigPath,\n normalizeViteConfigFilePath,\n} from '../../utils/options-utils';\nimport { ViteBuildExecutorOptions } from './schema';\nimport {\n copyAssets,\n createLockFile,\n createPackageJson,\n getLockFileName,\n} from '@nx/js';\nimport { existsSync, writeFileSync } from 'fs';\nimport { relative, resolve } from 'path';\nimport {\n combineAsyncIterables,\n createAsyncIterable,\n} from '@nx/devkit/src/utils/async-iterable';\nimport {\n createBuildableTsConfig,\n loadViteDynamicImport,\n validateTypes,\n} from '../../utils/executor-utils';\nimport { type Plugin } from 'vite';\nimport { isUsingTsSolutionSetup } from '@nx/js/src/utils/typescript/ts-solution-setup';\n\nexport async function* viteBuildExecutor(\n options: Record<string, any> & ViteBuildExecutorOptions,\n context: ExecutorContext\n) {\n process.env.VITE_CJS_IGNORE_WARNING = 'true';\n // Allows ESM to be required in CJS modules. Vite will be published as ESM in the future.\n const { mergeConfig, build, resolveConfig, createBuilder } =\n await loadViteDynamicImport();\n const projectRoot =\n context.projectsConfigurations.projects[context.projectName].root;\n const tsConfigForBuild = createBuildableTsConfig(\n projectRoot,\n options,\n context\n );\n\n const viteConfigPath = normalizeViteConfigFilePath(\n context.root,\n projectRoot,\n options.configFile\n );\n const root =\n projectRoot === '.' || projectRoot === ''\n ? process.cwd()\n : relative(context.cwd, joinPathFragments(context.root, projectRoot));\n\n const { buildOptions, otherOptions } = await getBuildExtraArgs(options);\n const defaultMode = otherOptions?.mode ?? 'production';\n\n const resolved = await resolveConfig(\n {\n configFile: viteConfigPath,\n mode: defaultMode,\n },\n 'build',\n defaultMode,\n process.env.NODE_ENV ?? defaultMode\n );\n\n const outDir =\n joinPathFragments(offsetFromRoot(projectRoot), options.outputPath) ??\n resolved?.build?.outDir;\n\n const buildConfig = mergeConfig(\n {\n // This should not be needed as it's going to be set in vite.config.ts\n // but leaving it here in case someone did not migrate correctly\n root: resolved.root ?? root,\n configFile: viteConfigPath,\n },\n {\n build: {\n outDir,\n ...buildOptions,\n },\n ...otherOptions,\n }\n );\n // New TS Solution already has a typecheck target\n if (!options.skipTypeCheck && !isUsingTsSolutionSetup()) {\n await validateTypes({\n workspaceRoot: context.root,\n tsconfig: tsConfigForBuild,\n isVueProject: Boolean(\n resolved.plugins?.find(\n (plugin: Plugin) =>\n typeof plugin === 'object' && plugin?.name === 'vite:vue'\n )\n ),\n });\n }\n\n const builder =\n createBuilder !== undefined && options.useEnvironmentsApi\n ? await createBuilder(buildConfig)\n : // This is needed to ensure support for Vite 5\n {\n build: (inlineConfig) => build(inlineConfig),\n environments: { build: buildConfig },\n };\n\n let iterables: AsyncIterable<{ success: boolean; outfile?: string }>[] = [];\n for (const env of Object.values(builder.environments)) {\n // This is needed to overwrite the resolve build config with executor options in Vite 6\n if (env.config?.build) {\n env.config.build = {\n ...env.config.build,\n ...buildConfig.build,\n };\n }\n const watcherOrOutput = await builder.build(env as any);\n\n const libraryPackageJson = resolve(projectRoot, 'package.json');\n const rootPackageJson = resolve(context.root, 'package.json');\n\n // Here, we want the outdir relative to the workspace root.\n // So, we calculate the relative path from the workspace root to the outdir.\n const absoluteOutDir = resolve(resolve(context.root, projectRoot), outDir);\n const outDirRelativeToWorkspaceRoot = relative(\n context.root,\n absoluteOutDir\n );\n const distPackageJson = resolve(\n outDirRelativeToWorkspaceRoot,\n 'package.json'\n );\n\n // Generate a package.json if option has been set.\n if (options.generatePackageJson) {\n if (context.projectGraph.nodes[context.projectName].type !== 'app') {\n logger.warn(\n stripIndents`The project ${context.projectName} is using the 'generatePackageJson' option which is deprecated for library projects. It should only be used for applications.\n For libraries, configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/nx-api/eslint-plugin/documents/dependency-checks).`\n );\n }\n\n const builtPackageJson = createPackageJson(\n context.projectName,\n context.projectGraph,\n {\n target: context.targetName,\n root: context.root,\n isProduction: !options.includeDevDependenciesInPackageJson, // By default we remove devDependencies since this is a production build.\n skipOverrides: options.skipOverrides,\n skipPackageManager: options.skipPackageManager,\n }\n );\n\n builtPackageJson.type ??= 'module';\n\n writeJsonFile(\n `${outDirRelativeToWorkspaceRoot}/package.json`,\n builtPackageJson\n );\n const packageManager = detectPackageManager(context.root);\n\n if (packageManager === 'bun') {\n logger.warn(\n 'Bun lockfile generation is not supported. The generated package.json will not include a lockfile. Run \"bun install\" in the output directory after deployment if needed.'\n );\n } else {\n const lockFile = createLockFile(\n builtPackageJson,\n context.projectGraph,\n packageManager\n );\n writeFileSync(\n `${outDirRelativeToWorkspaceRoot}/${getLockFileName(packageManager)}`,\n lockFile,\n {\n encoding: 'utf-8',\n }\n );\n }\n }\n // For buildable libs, copy package.json if it exists.\n else if (\n options.generatePackageJson !== false &&\n !existsSync(distPackageJson) &&\n existsSync(libraryPackageJson) &&\n rootPackageJson !== libraryPackageJson\n ) {\n await copyAssets(\n {\n outputPath: outDirRelativeToWorkspaceRoot,\n assets: [\n {\n input: projectRoot,\n output: '.',\n glob: 'package.json',\n },\n ],\n },\n context\n );\n }\n\n const iterable = createAsyncIterable<{\n success: boolean;\n outfile?: string;\n }>(({ next, done }) => {\n if ('on' in watcherOrOutput) {\n let success = true;\n watcherOrOutput.on('event', (event) => {\n if (event.code === 'START') {\n success = true;\n } else if (event.code === 'ERROR') {\n success = false;\n } else if (event.code === 'END') {\n next({ success });\n }\n // result must be closed when present.\n // see https://rollupjs.org/guide/en/#rollupwatch\n if ('result' in event && event.result) {\n event.result.close();\n }\n });\n } else {\n const output =\n watcherOrOutput?.['output'] || watcherOrOutput?.[0]?.output;\n const fileName = output?.[0]?.fileName || 'main.cjs';\n const outfile = resolve(outDirRelativeToWorkspaceRoot, fileName);\n next({ success: true, outfile });\n done();\n }\n });\n iterables.push(iterable);\n }\n return yield* combineAsyncIterables(iterables.shift(), ...(iterables ?? []));\n}\n\nexport async function getBuildExtraArgs(\n options: ViteBuildExecutorOptions\n): Promise<{\n // vite BuildOptions\n buildOptions: Record<string, unknown>;\n otherOptions: Record<string, any>;\n}> {\n // support passing extra args to vite cli\n const schema = await import('./schema.json');\n const extraArgs = {};\n for (const key of Object.keys(options)) {\n if (!schema.properties[key]) {\n extraArgs[key] = options[key];\n }\n }\n\n const buildOptions = {};\n const buildSchemaKeys = [\n 'target',\n 'polyfillModulePreload',\n 'modulePreload',\n 'outDir',\n 'assetsDir',\n 'assetsInlineLimit',\n 'cssCodeSplit',\n 'cssTarget',\n 'cssMinify',\n 'sourcemap',\n 'minify',\n 'terserOptions',\n 'rollupOptions',\n 'commonjsOptions',\n 'dynamicImportVarsOptions',\n 'write',\n 'emptyOutDir',\n 'copyPublicDir',\n 'manifest',\n 'lib',\n 'ssr',\n 'ssrManifest',\n 'ssrEmitAssets',\n 'reportCompressedSize',\n 'chunkSizeWarningLimit',\n 'watch',\n ];\n const otherOptions = {};\n for (const key of Object.keys(extraArgs)) {\n if (buildSchemaKeys.includes(key)) {\n buildOptions[key] = extraArgs[key];\n } else {\n otherOptions[key] = extraArgs[key];\n }\n }\n\n buildOptions['watch'] = options.watch ?? undefined;\n\n return {\n buildOptions,\n otherOptions,\n };\n}\n\nexport default viteBuildExecutor;\n"],"names":["getBuildExtraArgs","viteBuildExecutor","options","context","resolved","process","env","VITE_CJS_IGNORE_WARNING","mergeConfig","build","resolveConfig","createBuilder","loadViteDynamicImport","projectRoot","projectsConfigurations","projects","projectName","root","tsConfigForBuild","createBuildableTsConfig","viteConfigPath","normalizeViteConfigFilePath","configFile","cwd","relative","joinPathFragments","buildOptions","otherOptions","defaultMode","mode","NODE_ENV","outDir","offsetFromRoot","outputPath","buildConfig","skipTypeCheck","isUsingTsSolutionSetup","validateTypes","workspaceRoot","tsconfig","isVueProject","Boolean","plugins","find","plugin","name","builder","undefined","useEnvironmentsApi","inlineConfig","environments","iterables","Object","values","config","watcherOrOutput","libraryPackageJson","resolve","rootPackageJson","absoluteOutDir","outDirRelativeToWorkspaceRoot","distPackageJson","generatePackageJson","builtPackageJson","projectGraph","nodes","type","logger","warn","stripIndents","createPackageJson","target","targetName","isProduction","includeDevDependenciesInPackageJson","skipOverrides","skipPackageManager","writeJsonFile","packageManager","detectPackageManager","lockFile","createLockFile","writeFileSync","getLockFileName","encoding","existsSync","copyAssets","assets","input","output","glob","iterable","createAsyncIterable","next","done","success","on","event","code","result","close","fileName","outfile","push","combineAsyncIterables","shift","schema","extraArgs","key","keys","properties","buildSchemaKeys","includes","watch"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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jB;IACA,OAAO,OAAOa,IAAAA,oCAAqB,EAACrD,UAAUsD,KAAK,OAAQtD,oBAAAA,YAAa,EAAE;AAC5E;AAEO,eAAenD,kBACpBE,OAAiC;IAMjC,yCAAyC;IACzC,MAAMwG,SAAS,MAAM,2BAAA,QAAO;IAC5B,MAAMC,YAAY,CAAC;IACnB,KAAK,MAAMC,OAAOxD,OAAOyD,IAAI,CAAC3G,SAAU;QACtC,IAAI,CAACwG,OAAOI,UAAU,CAACF,IAAI,EAAE;YAC3BD,SAAS,CAACC,IAAI,GAAG1G,OAAO,CAAC0G,IAAI;QAC/B;IACF;IAEA,MAAMlF,eAAe,CAAC;IACtB,MAAMqF,kBAAkB;QACtB;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IACD,MAAMpF,eAAe,CAAC;IACtB,KAAK,MAAMiF,OAAOxD,OAAOyD,IAAI,CAACF,WAAY;QACxC,IAAII,gBAAgBC,QAAQ,CAACJ,MAAM;YACjClF,YAAY,CAACkF,IAAI,GAAGD,SAAS,CAACC,IAAI;QACpC,OAAO;YACLjF,YAAY,CAACiF,IAAI,GAAGD,SAAS,CAACC,IAAI;QACpC;IACF;QAEwB1G;IAAxBwB,YAAY,CAAC,QAAQ,GAAGxB,CAAAA,iBAAAA,QAAQ+G,KAAK,YAAb/G,iBAAiB6C;IAEzC,OAAO;QACLrB;QACAC;IACF;AACF;MAEA,WAAe1B"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/vite/src/executors/build/compat.ts"],"sourcesContent":["import { convertNxExecutor } from '@nx/devkit';\nimport viteBuildExecutor from './build.impl';\n\nexport default convertNxExecutor(viteBuildExecutor);\n"],"names":["convertNxExecutor","viteBuildExecutor"],"rangeMappings":";;;;;;;;;","mappings":";+BAGA;;;eAAA;;;wBAHkC;2BACJ;MAE9B,WAAeA,IAAAA,yBAAiB,EAACC,kBAAiB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
-
3
- //# sourceMappingURL=schema.d.js.map