@nx/vite 22.1.0-beta.1 → 22.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/vite",
3
- "version": "22.1.0-beta.1",
3
+ "version": "22.1.0-beta.2",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for building and testing applications using Vite",
6
6
  "repository": {
@@ -30,10 +30,10 @@
30
30
  "migrations": "./migrations.json"
31
31
  },
32
32
  "dependencies": {
33
- "@nx/devkit": "22.1.0-beta.1",
33
+ "@nx/devkit": "22.1.0-beta.2",
34
34
  "@phenomnomnominal/tsquery": "~5.0.1",
35
35
  "enquirer": "~2.3.6",
36
- "@nx/js": "22.1.0-beta.1",
36
+ "@nx/js": "22.1.0-beta.2",
37
37
  "picomatch": "4.0.2",
38
38
  "tsconfig-paths": "^4.1.2",
39
39
  "semver": "^7.6.3",
@@ -41,7 +41,7 @@
41
41
  "ajv": "^8.0.0"
42
42
  },
43
43
  "devDependencies": {
44
- "nx": "22.1.0-beta.1"
44
+ "nx": "22.1.0-beta.2"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -3,7 +3,7 @@
3
3
  "outputCapture": "direct-nodejs",
4
4
  "title": "Vite Prod Builder",
5
5
  "cli": "nx",
6
- "description": "Builds a Vite.js application for production.",
6
+ "description": "Builds a Vite application for production.",
7
7
  "type": "object",
8
8
  "presets": [
9
9
  {
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "configFile": {
38
38
  "type": "string",
39
- "description": "The name of the Vite.js configuration file.",
39
+ "description": "The name of the Vite configuration file.",
40
40
  "x-completion-type": "file",
41
41
  "x-completion-glob": "vite.config.@(js|ts)"
42
42
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "cli": "nx",
3
- "title": "Configure a project to use Vite.js.",
4
- "description": "Configure a project to use Vite.js.",
3
+ "title": "Configure a project to use Vite.",
4
+ "description": "Configure a project to use Vite.",
5
5
  "$id": "configure-vite-project",
6
6
  "type": "object",
7
7
  "properties": {
@@ -12,6 +12,14 @@ export interface VitePluginOptions {
12
12
  typecheckTargetName?: string;
13
13
  watchDepsTargetName?: string;
14
14
  buildDepsTargetName?: string;
15
+ /**
16
+ * Atomizer for vitest
17
+ */
18
+ ciTargetName?: string;
19
+ /**
20
+ * The name that should be used to group atomized tasks on CI
21
+ */
22
+ ciGroupName?: string;
15
23
  }
16
24
  /**
17
25
  * @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/vite/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAQd,MAAM,YAAY,CAAC;AAkBpB,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAiBD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAuGxD,CAAC;AAEF,eAAO,MAAM,aAAa,kCAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/vite/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EASd,MAAM,YAAY,CAAC;AAgBpB,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAiBD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAuGxD,CAAC;AAEF,eAAO,MAAM,aAAa,kCAAc,CAAC"}
@@ -2,20 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createNodesV2 = exports.createNodes = exports.createDependencies = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const path_1 = require("path");
6
- const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
7
- const fs_1 = require("fs");
8
5
  const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
9
- const cache_directory_1 = require("nx/src/utils/cache-directory");
6
+ const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
10
7
  const js_1 = require("@nx/js");
11
- const executor_utils_1 = require("../utils/executor-utils");
8
+ const util_1 = require("@nx/js/src/plugins/typescript/util");
9
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
10
+ const node_fs_1 = require("node:fs");
11
+ const node_path_1 = require("node:path");
12
12
  const file_hasher_1 = require("nx/src/hasher/file-hasher");
13
+ const cache_directory_1 = require("nx/src/utils/cache-directory");
14
+ const plugins_1 = require("nx/src/utils/plugins");
15
+ const executor_utils_1 = require("../utils/executor-utils");
13
16
  const picomatch = require("picomatch");
14
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
15
- const util_1 = require("@nx/js/src/plugins/typescript/util");
16
17
  const pmc = (0, devkit_1.getPackageManagerCommand)();
17
18
  function readTargetsCache(cachePath) {
18
- return process.env.NX_CACHE_PROJECT_GRAPH !== 'false' && (0, fs_1.existsSync)(cachePath)
19
+ return process.env.NX_CACHE_PROJECT_GRAPH !== 'false' && (0, node_fs_1.existsSync)(cachePath)
19
20
  ? (0, devkit_1.readJsonFile)(cachePath)
20
21
  : {};
21
22
  }
@@ -35,11 +36,11 @@ exports.createNodes = [
35
36
  async (configFilePaths, options, context) => {
36
37
  const optionsHash = (0, file_hasher_1.hashObject)(options);
37
38
  const normalizedOptions = normalizeOptions(options);
38
- const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `vite-${optionsHash}.hash`);
39
+ const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `vite-${optionsHash}.hash`);
39
40
  const targetsCache = readTargetsCache(cachePath);
40
41
  const isUsingTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
41
42
  const { roots: projectRoots, configFiles: validConfigFiles } = configFilePaths.reduce((acc, configFile) => {
42
- const potentialRoot = (0, path_1.dirname)(configFile);
43
+ const potentialRoot = (0, node_path_1.dirname)(configFile);
43
44
  if (checkIfConfigFileShouldBeProject(potentialRoot, context)) {
44
45
  acc.roots.push(potentialRoot);
45
46
  acc.configFiles.push(configFile);
@@ -53,9 +54,9 @@ exports.createNodes = [
53
54
  const hashes = await (0, calculate_hash_for_create_nodes_1.calculateHashesForCreateNodes)(projectRoots, { ...normalizedOptions, isUsingTsSolutionSetup }, context, projectRoots.map((r) => [lockfile]));
54
55
  try {
55
56
  return await (0, devkit_1.createNodesFromFiles)(async (configFile, _, context, idx) => {
56
- const projectRoot = (0, path_1.dirname)(configFile);
57
+ const projectRoot = (0, node_path_1.dirname)(configFile);
57
58
  // Do not create a project if package.json and project.json isn't there.
58
- const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
59
+ const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, projectRoot));
59
60
  const tsConfigFiles = siblingFiles.filter((p) => picomatch('tsconfig*{.json,.*.json}')(p)) ?? [];
60
61
  const hasReactRouterConfig = siblingFiles.some((configFile) => {
61
62
  const parts = configFile.split('.');
@@ -109,12 +110,84 @@ async function buildViteTargets(configFilePath, projectRoot, options, tsConfigFi
109
110
  configFile: absoluteConfigFilePath,
110
111
  mode: 'development',
111
112
  }, 'build');
113
+ let metadata = {};
112
114
  const { buildOutputs, testOutputs, hasTest, isBuildable, hasServeConfig } = getOutputs(viteBuildConfig, projectRoot, context.workspaceRoot);
113
115
  const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
114
116
  const targets = {};
115
- // if file is vitest.config or vite.config has definition for test, create target for test
117
+ // if file is vitest.config or vite.config has definition for test, create targets for test and/or atomized tests
116
118
  if (configFilePath.includes('vitest.config') || hasTest) {
117
119
  targets[options.testTargetName] = await testTarget(namedInputs, testOutputs, projectRoot);
120
+ if (options.ciTargetName) {
121
+ const groupName = options.ciGroupName ?? (0, plugins_1.deriveGroupNameFromTarget)(options.ciTargetName);
122
+ const targetGroup = [];
123
+ const dependsOn = [];
124
+ metadata = {
125
+ targetGroups: {
126
+ [groupName]: targetGroup,
127
+ },
128
+ };
129
+ const projectRootRelativeTestPaths = await getTestPathsRelativeToProjectRoot(projectRoot);
130
+ for (const relativePath of projectRootRelativeTestPaths) {
131
+ if (relativePath.includes('../')) {
132
+ throw new Error('@nx/vite/plugin attempted to run tests outside of the project root. This is not supported and should not happen. Please open an issue at https://github.com/nrwl/nx/issues/new/choose with the following information:\n\n' +
133
+ `\n\n${JSON.stringify({
134
+ projectRoot,
135
+ relativePath,
136
+ projectRootRelativeTestPaths,
137
+ context,
138
+ }, null, 2)}`);
139
+ }
140
+ const targetName = `${options.ciTargetName}--${relativePath}`;
141
+ dependsOn.push(targetName);
142
+ targets[targetName] = {
143
+ // It does not make sense to run atomized tests in watch mode as they are intended to be run in CI
144
+ command: `vitest run ${relativePath}`,
145
+ cache: targets[options.testTargetName].cache,
146
+ inputs: targets[options.testTargetName].inputs,
147
+ outputs: targets[options.testTargetName].outputs,
148
+ options: {
149
+ cwd: projectRoot,
150
+ env: targets[options.testTargetName].options.env,
151
+ },
152
+ metadata: {
153
+ technologies: ['vitest'],
154
+ description: `Run Vitest Tests in ${relativePath}`,
155
+ help: {
156
+ command: `${pmc.exec} vitest --help`,
157
+ example: {
158
+ options: {
159
+ coverage: true,
160
+ },
161
+ },
162
+ },
163
+ },
164
+ };
165
+ targetGroup.push(targetName);
166
+ }
167
+ if (targetGroup.length > 0) {
168
+ targets[options.ciTargetName] = {
169
+ executor: 'nx:noop',
170
+ cache: true,
171
+ inputs: targets[options.testTargetName].inputs,
172
+ outputs: targets[options.testTargetName].outputs,
173
+ dependsOn,
174
+ metadata: {
175
+ technologies: ['vitest'],
176
+ description: 'Run Vitest Tests in CI',
177
+ nonAtomizedTarget: options.testTargetName,
178
+ help: {
179
+ command: `${pmc.exec} vitest --help`,
180
+ example: {
181
+ options: {
182
+ coverage: true,
183
+ },
184
+ },
185
+ },
186
+ },
187
+ };
188
+ targetGroup.unshift(options.ciTargetName);
189
+ }
190
+ }
118
191
  }
119
192
  if (hasReactRouterConfig) {
120
193
  // If we have a react-router config, we can skip the rest of the targets
@@ -186,7 +259,6 @@ async function buildViteTargets(configFilePath, projectRoot, options, tsConfigFi
186
259
  }
187
260
  }
188
261
  (0, util_1.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
189
- const metadata = {};
190
262
  return {
191
263
  targets,
192
264
  metadata,
@@ -324,7 +396,7 @@ function getOutputs(viteBuildConfig, projectRoot, workspaceRoot) {
324
396
  const buildOutputPath = normalizeOutputPath(build?.outDir, projectRoot, workspaceRoot, 'dist');
325
397
  const isBuildable = build?.lib ||
326
398
  build?.rollupOptions?.input ||
327
- (0, fs_1.existsSync)((0, path_1.join)(workspaceRoot, projectRoot, 'index.html'));
399
+ (0, node_fs_1.existsSync)((0, node_path_1.join)(workspaceRoot, projectRoot, 'index.html'));
328
400
  const hasServeConfig = Boolean(server?.host || server?.port);
329
401
  const reportsDirectoryPath = normalizeOutputPath(test?.coverage?.reportsDirectory, projectRoot, workspaceRoot, 'coverage');
330
402
  return {
@@ -345,15 +417,15 @@ function normalizeOutputPath(outputPath, projectRoot, workspaceRoot, path) {
345
417
  }
346
418
  }
347
419
  else {
348
- if ((0, path_1.isAbsolute)(outputPath)) {
349
- return `{workspaceRoot}/${(0, path_1.relative)(workspaceRoot, outputPath)}`;
420
+ if ((0, node_path_1.isAbsolute)(outputPath)) {
421
+ return `{workspaceRoot}/${(0, node_path_1.relative)(workspaceRoot, outputPath)}`;
350
422
  }
351
423
  else {
352
424
  if (outputPath.startsWith('..')) {
353
- return (0, path_1.join)('{workspaceRoot}', (0, path_1.join)(projectRoot, outputPath));
425
+ return (0, node_path_1.join)('{workspaceRoot}', (0, node_path_1.join)(projectRoot, outputPath));
354
426
  }
355
427
  else {
356
- return (0, path_1.join)('{projectRoot}', outputPath);
428
+ return (0, node_path_1.join)('{projectRoot}', outputPath);
357
429
  }
358
430
  }
359
431
  }
@@ -371,10 +443,21 @@ function normalizeOptions(options) {
371
443
  }
372
444
  function checkIfConfigFileShouldBeProject(projectRoot, context) {
373
445
  // Do not create a project if package.json and project.json isn't there.
374
- const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
446
+ const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, projectRoot));
375
447
  if (!siblingFiles.includes('package.json') &&
376
448
  !siblingFiles.includes('project.json')) {
377
449
  return false;
378
450
  }
379
451
  return true;
380
452
  }
453
+ async function getTestPathsRelativeToProjectRoot(projectRoot) {
454
+ const fullProjectRoot = (0, node_path_1.join)(devkit_1.workspaceRoot, projectRoot);
455
+ const { createVitest } = await Promise.resolve().then(() => require('vitest/node'));
456
+ const vitest = await createVitest('test', {
457
+ dir: fullProjectRoot,
458
+ filesOnly: true,
459
+ watch: false,
460
+ });
461
+ const relevantTestSpecifications = await vitest.getRelevantTestSpecifications();
462
+ return relevantTestSpecifications.map((ts) => (0, node_path_1.relative)(projectRoot, ts.moduleId));
463
+ }
@@ -282,7 +282,7 @@ function createOrEditViteConfig(tree, options, onlyVitest, projectAlreadyHasVite
282
282
  ? ''
283
283
  : options.includeLib
284
284
  ? ` // Configuration for building your library.
285
- // See: https://vitejs.dev/guide/build.html#library-mode
285
+ // See: https://vite.dev/guide/build.html#library-mode
286
286
  build: {
287
287
  outDir: '${buildOutDir}',
288
288
  emptyOutDir: true,
@@ -435,8 +435,8 @@ async function handleUnsupportedUserProvidedTargetsErrors(userProvidedTargetName
435
435
  devkit_1.logger.warn(`The custom ${target} target you provided (${userProvidedTargetName}) cannot be converted to use the @nx/vite:${executor} executor.
436
436
  However, we found the following ${target} target in your project that can be converted: ${validFoundTargetName}
437
437
 
438
- Please note that converting a potentially non-compatible project to use Vite.js may result in unexpected behavior. Always commit
439
- your changes before converting a project to use Vite.js, and test the converted project thoroughly before deploying it.
438
+ Please note that converting a potentially non-compatible project to use Vite may result in unexpected behavior. Always commit
439
+ your changes before converting a project to use Vite, and test the converted project thoroughly before deploying it.
440
440
  `);
441
441
  const { Confirm } = require('enquirer');
442
442
  const prompt = new Confirm({
@@ -450,8 +450,8 @@ async function handleUnsupportedUserProvidedTargetsErrors(userProvidedTargetName
450
450
  Please try again, either by providing a different ${target} target or by not providing a target at all (Nx will
451
451
  convert the first one it finds, most probably this one: ${validFoundTargetName})
452
452
 
453
- Please note that converting a potentially non-compatible project to use Vite.js may result in unexpected behavior. Always commit
454
- your changes before converting a project to use Vite.js, and test the converted project thoroughly before deploying it.
453
+ Please note that converting a potentially non-compatible project to use Vite may result in unexpected behavior. Always commit
454
+ your changes before converting a project to use Vite, and test the converted project thoroughly before deploying it.
455
455
  `);
456
456
  }
457
457
  }
@@ -5,8 +5,8 @@ export declare const conditionalConfig = "\n /// <reference types=\"vitest\"
5
5
  export declare const configNoDefineConfig = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n\n export default {\n plugins: [\n react(),\n nxViteTsPaths(),\n ],\n };\n ";
6
6
  export declare const noBuildOptionsHasTestOption = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n\n export default defineConfig({\n \n cacheDir: '../../node_modules/.vitest',\n plugins: [\n react(),\n nxViteTsPaths(),\n ],\n\n test: {\n globals: true,\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n\n });\n ";
7
7
  export declare const someBuildOptionsSomeTestOption = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n\n export default defineConfig({\n plugins: [\n react(),\n nxViteTsPaths(),\n ],\n\n test: {\n my: 'option',\n },\n\n build: {\n my: 'option',\n }\n\n });\n ";
8
- export declare const hasEverything = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n import dts from 'vite-plugin-dts';\n import { joinPathFragments } from '@nx/devkit';\n\n export default defineConfig({\n cacheDir: '../../node_modules/.vitest',\n plugins: [\n dts({ entryRoot: 'src', tsConfigFilePath: joinPathFragments(__dirname, 'tsconfig.lib.json'), skipDiagnostics: true }),\n react(),\n nxViteTsPaths(),\n ],\n \n // Configuration for building your library.\n // See: https://vitejs.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'pure-libs-react-vite',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es'],\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime'],\n },\n },\n \n test: {\n globals: true,\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n });\n ";
9
- export declare const buildOption = "\n // Configuration for building your library.\n // See: https://vitejs.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'my-app',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es']\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime']\n }\n },";
8
+ export declare const hasEverything = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n import dts from 'vite-plugin-dts';\n import { joinPathFragments } from '@nx/devkit';\n\n export default defineConfig({\n cacheDir: '../../node_modules/.vitest',\n plugins: [\n dts({ entryRoot: 'src', tsConfigFilePath: joinPathFragments(__dirname, 'tsconfig.lib.json'), skipDiagnostics: true }),\n react(),\n nxViteTsPaths(),\n ],\n \n // Configuration for building your library.\n // See: https://vite.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'pure-libs-react-vite',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es'],\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime'],\n },\n },\n \n test: {\n globals: true,\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n });\n ";
9
+ export declare const buildOption = "\n // Configuration for building your library.\n // See: https://vite.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'my-app',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es']\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime']\n }\n },";
10
10
  export declare const buildOptionObject: {
11
11
  lib: {
12
12
  entry: string;
@@ -1 +1 @@
1
- {"version":3,"file":"test-vite-configs.d.ts","sourceRoot":"","sources":["../../../../../../packages/vite/src/utils/test-files/test-vite-configs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,iiBAoBtB,CAAC;AAEN,eAAO,MAAM,gBAAgB,mlBAwBxB,CAAC;AAEN,eAAO,MAAM,qBAAqB,oQAO7B,CAAC;AAEN,eAAO,MAAM,iBAAiB,4YAgBzB,CAAC;AAEN,eAAO,MAAM,oBAAoB,oUAY5B,CAAC;AAEN,eAAO,MAAM,2BAA2B,uiBAqBnC,CAAC;AAEN,eAAO,MAAM,8BAA8B,wbAqBtC,CAAC;AAEN,eAAO,MAAM,aAAa,o7CAwCrB,CAAC;AAEN,eAAO,MAAM,WAAW,goBAiBjB,CAAC;AACR,eAAO,MAAM,iBAAiB;;;;;;;;;;CAU7B,CAAC;AAEF,eAAO,MAAM,UAAU,uJAIhB,CAAC;AAER,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAO,MAAM,OAAO,UAGnB,CAAC;AAEF,eAAO,MAAM,OAAO,UAAiC,CAAC"}
1
+ {"version":3,"file":"test-vite-configs.d.ts","sourceRoot":"","sources":["../../../../../../packages/vite/src/utils/test-files/test-vite-configs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,iiBAoBtB,CAAC;AAEN,eAAO,MAAM,gBAAgB,mlBAwBxB,CAAC;AAEN,eAAO,MAAM,qBAAqB,oQAO7B,CAAC;AAEN,eAAO,MAAM,iBAAiB,4YAgBzB,CAAC;AAEN,eAAO,MAAM,oBAAoB,oUAY5B,CAAC;AAEN,eAAO,MAAM,2BAA2B,uiBAqBnC,CAAC;AAEN,eAAO,MAAM,8BAA8B,wbAqBtC,CAAC;AAEN,eAAO,MAAM,aAAa,k7CAwCrB,CAAC;AAEN,eAAO,MAAM,WAAW,8nBAiBjB,CAAC;AACR,eAAO,MAAM,iBAAiB;;;;;;;;;;CAU7B,CAAC;AAEF,eAAO,MAAM,UAAU,uJAIhB,CAAC;AAER,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAO,MAAM,OAAO,UAGnB,CAAC;AAEF,eAAO,MAAM,OAAO,UAAiC,CAAC"}
@@ -146,7 +146,7 @@ exports.hasEverything = `
146
146
  ],
147
147
 
148
148
  // Configuration for building your library.
149
- // See: https://vitejs.dev/guide/build.html#library-mode
149
+ // See: https://vite.dev/guide/build.html#library-mode
150
150
  build: {
151
151
  lib: {
152
152
  // Could also be a dictionary or array of multiple entry points.
@@ -172,7 +172,7 @@ exports.hasEverything = `
172
172
  `;
173
173
  exports.buildOption = `
174
174
  // Configuration for building your library.
175
- // See: https://vitejs.dev/guide/build.html#library-mode
175
+ // See: https://vite.dev/guide/build.html#library-mode
176
176
  build: {
177
177
  lib: {
178
178
  // Could also be a dictionary or array of multiple entry points.