@nx/vite 23.3.0-pr.36841.f66e88b → 23.3.0-pr.37068.f95e11e

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.
@@ -127,7 +127,7 @@ async function buildViteTargets(configFilePath, projectRoot, options, tsConfigFi
127
127
  targets[options.buildTargetName] = await buildTarget(options.buildTargetName, namedInputs, buildOutputs, projectRoot, isUsingTsSolutionSetup, pmc);
128
128
  // If running in library mode, then there is nothing to serve.
129
129
  if (!viteBuildConfig.build?.lib || hasServeConfig) {
130
- const devTarget = serveTarget(projectRoot, isUsingTsSolutionSetup, pmc);
130
+ const devTarget = serveTarget(projectRoot, isUsingTsSolutionSetup, pmc, namedInputs);
131
131
  targets[options.serveTargetName] = {
132
132
  ...devTarget,
133
133
  metadata: {
@@ -136,8 +136,8 @@ async function buildViteTargets(configFilePath, projectRoot, options, tsConfigFi
136
136
  },
137
137
  };
138
138
  targets[options.devTargetName] = devTarget;
139
- targets[options.previewTargetName] = previewTarget(projectRoot, options.buildTargetName, pmc);
140
- targets[options.serveStaticTargetName] = serveStaticTarget(options, isUsingTsSolutionSetup);
139
+ targets[options.previewTargetName] = previewTarget(projectRoot, options.buildTargetName, pmc, namedInputs);
140
+ targets[options.serveStaticTargetName] = serveStaticTarget(options, isUsingTsSolutionSetup, namedInputs);
141
141
  }
142
142
  }
143
143
  if (tsConfigFiles.length) {
@@ -200,14 +200,7 @@ async function buildTarget(buildTargetName, namedInputs, outputs, projectRoot, i
200
200
  options: { cwd: (0, devkit_1.joinPathFragments)(projectRoot) },
201
201
  cache: true,
202
202
  dependsOn: [`^${buildTargetName}`],
203
- inputs: [
204
- ...('production' in namedInputs
205
- ? ['production', '^production']
206
- : ['default', '^default']),
207
- {
208
- externalDependencies: ['vite'],
209
- },
210
- ],
203
+ inputs: buildInputs(namedInputs),
211
204
  outputs,
212
205
  metadata: {
213
206
  technologies: ['vite'],
@@ -228,9 +221,20 @@ async function buildTarget(buildTargetName, namedInputs, outputs, projectRoot, i
228
221
  }
229
222
  return buildTarget;
230
223
  }
231
- function serveTarget(projectRoot, isUsingTsSolutionSetup, pmc) {
224
+ function buildInputs(namedInputs) {
225
+ return [
226
+ ...('production' in namedInputs
227
+ ? ['production', '^production']
228
+ : ['default', '^default']),
229
+ {
230
+ externalDependencies: ['vite'],
231
+ },
232
+ ];
233
+ }
234
+ function serveTarget(projectRoot, isUsingTsSolutionSetup, pmc, namedInputs) {
232
235
  const targetConfig = {
233
236
  continuous: true,
237
+ inputs: buildInputs(namedInputs),
234
238
  command: `vite`,
235
239
  options: {
236
240
  cwd: (0, devkit_1.joinPathFragments)(projectRoot),
@@ -253,9 +257,10 @@ function serveTarget(projectRoot, isUsingTsSolutionSetup, pmc) {
253
257
  }
254
258
  return targetConfig;
255
259
  }
256
- function previewTarget(projectRoot, buildTargetName, pmc) {
260
+ function previewTarget(projectRoot, buildTargetName, pmc, namedInputs) {
257
261
  const targetConfig = {
258
262
  continuous: true,
263
+ inputs: buildInputs(namedInputs),
259
264
  command: `vite preview`,
260
265
  dependsOn: [buildTargetName],
261
266
  options: {
@@ -276,9 +281,10 @@ function previewTarget(projectRoot, buildTargetName, pmc) {
276
281
  };
277
282
  return targetConfig;
278
283
  }
279
- function serveStaticTarget(options, isUsingTsSolutionSetup) {
284
+ function serveStaticTarget(options, isUsingTsSolutionSetup, namedInputs) {
280
285
  const targetConfig = {
281
286
  continuous: true,
287
+ inputs: buildInputs(namedInputs),
282
288
  executor: '@nx/web:file-server',
283
289
  options: {
284
290
  buildTarget: `${options.buildTargetName}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/vite",
3
- "version": "23.3.0-pr.36841.f66e88b",
3
+ "version": "23.3.0-pr.37068.f95e11e",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -100,13 +100,13 @@
100
100
  "semver": "^7.6.3",
101
101
  "tslib": "^2.3.0",
102
102
  "ajv": "^8.0.0",
103
- "@nx/devkit": "23.3.0-pr.36841.f66e88b",
104
- "@nx/js": "23.3.0-pr.36841.f66e88b",
105
- "@nx/vitest": "23.3.0-pr.36841.f66e88b"
103
+ "@nx/devkit": "23.3.0-pr.37068.f95e11e",
104
+ "@nx/js": "23.3.0-pr.37068.f95e11e",
105
+ "@nx/vitest": "23.3.0-pr.37068.f95e11e"
106
106
  },
107
107
  "devDependencies": {
108
- "@nx/eslint": "23.3.0-pr.36841.f66e88b",
109
- "nx": "23.3.0-pr.36841.f66e88b"
108
+ "@nx/eslint": "23.3.0-pr.37068.f95e11e",
109
+ "nx": "23.3.0-pr.37068.f95e11e"
110
110
  },
111
111
  "peerDependencies": {
112
112
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"