vite 6.4.1 → 7.1.12

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 (41) hide show
  1. package/LICENSE.md +76 -338
  2. package/README.md +1 -1
  3. package/bin/openChrome.js +68 -0
  4. package/bin/vite.js +7 -7
  5. package/dist/client/client.mjs +893 -921
  6. package/dist/client/env.mjs +14 -19
  7. package/dist/node/chunks/build.js +4 -0
  8. package/dist/node/chunks/build2.js +5523 -0
  9. package/dist/node/chunks/chunk.js +31 -0
  10. package/dist/node/chunks/config.js +36197 -0
  11. package/dist/node/chunks/config2.js +4 -0
  12. package/dist/node/chunks/dist.js +6758 -0
  13. package/dist/node/chunks/lib.js +377 -0
  14. package/dist/node/chunks/logger.js +320 -0
  15. package/dist/node/chunks/moduleRunnerTransport.d.ts +88 -0
  16. package/dist/node/chunks/optimizer.js +4 -0
  17. package/dist/node/chunks/postcss-import.js +479 -0
  18. package/dist/node/chunks/preview.js +4 -0
  19. package/dist/node/chunks/server.js +4 -0
  20. package/dist/node/cli.js +614 -865
  21. package/dist/node/index.d.ts +2692 -3282
  22. package/dist/node/index.js +24 -188
  23. package/dist/node/module-runner.d.ts +251 -234
  24. package/dist/node/module-runner.js +992 -1177
  25. package/package.json +56 -61
  26. package/types/importGlob.d.ts +14 -0
  27. package/types/importMeta.d.ts +1 -2
  28. package/types/internal/cssPreprocessorOptions.d.ts +3 -22
  29. package/types/internal/terserOptions.d.ts +11 -0
  30. package/types/metadata.d.ts +0 -2
  31. package/bin/openChrome.applescript +0 -95
  32. package/dist/node/chunks/dep-3RmXg9uo.js +0 -553
  33. package/dist/node/chunks/dep-C9BXG1mU.js +0 -822
  34. package/dist/node/chunks/dep-CvfTChi5.js +0 -8218
  35. package/dist/node/chunks/dep-D4NMHUTW.js +0 -49531
  36. package/dist/node/chunks/dep-DWMUTS1A.js +0 -7113
  37. package/dist/node/constants.js +0 -149
  38. package/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts +0 -87
  39. package/dist/node-cjs/publicUtils.cjs +0 -3987
  40. package/index.cjs +0 -96
  41. package/index.d.cts +0 -6
@@ -1,194 +1,30 @@
1
- export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { a as arraify, i as isInNodeModules, D as DevEnvironment } from './chunks/dep-D4NMHUTW.js';
3
- export { B as BuildEnvironment, f as build, m as buildErrorMessage, g as createBuilder, F as createFilter, h as createIdResolver, I as createLogger, n as createRunnableDevEnvironment, c as createServer, y as createServerHotChannel, w as createServerModuleRunner, x as createServerModuleRunnerTransport, d as defineConfig, v as fetchModule, j as formatPostcssSourceMap, L as isFileLoadingAllowed, K as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, M as loadEnv, E as mergeAlias, C as mergeConfig, z as moduleRunnerTransform, A as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, N as resolveEnvPrefix, G as rollupVersion, u as runnerImport, J as searchForWorkspaceRoot, H as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-D4NMHUTW.js';
4
- export { defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, VERSION as version } from './constants.js';
5
- export { version as esbuildVersion } from 'esbuild';
6
- import 'node:fs';
7
- import 'node:path';
8
- import 'node:fs/promises';
9
- import 'node:url';
10
- import 'node:util';
11
- import 'node:perf_hooks';
12
- import 'node:module';
13
- import 'node:crypto';
14
- import 'picomatch';
15
- import 'path';
16
- import 'fs';
17
- import 'fdir';
18
- import 'node:child_process';
19
- import 'node:http';
20
- import 'node:https';
21
- import 'tty';
22
- import 'util';
23
- import 'net';
24
- import 'events';
25
- import 'url';
26
- import 'http';
27
- import 'stream';
28
- import 'os';
29
- import 'child_process';
30
- import 'node:os';
31
- import 'node:net';
32
- import 'node:dns';
33
- import 'vite/module-runner';
34
- import 'node:buffer';
35
- import 'module';
36
- import 'node:readline';
37
- import 'node:process';
38
- import 'node:events';
39
- import 'tinyglobby';
40
- import 'crypto';
41
- import 'node:assert';
42
- import 'node:v8';
43
- import 'node:worker_threads';
44
- import 'https';
45
- import 'tls';
46
- import 'zlib';
47
- import 'buffer';
48
- import 'assert';
49
- import 'node:querystring';
50
- import 'node:zlib';
51
-
52
- const CSS_LANGS_RE = (
53
- // eslint-disable-next-line regexp/no-unused-capturing-group
54
- /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/
55
- );
56
- const isCSSRequest = (request) => CSS_LANGS_RE.test(request);
57
- class SplitVendorChunkCache {
58
- cache;
59
- constructor() {
60
- this.cache = /* @__PURE__ */ new Map();
61
- }
62
- reset() {
63
- this.cache = /* @__PURE__ */ new Map();
64
- }
65
- }
66
- function splitVendorChunk(options = {}) {
67
- const cache = options.cache ?? new SplitVendorChunkCache();
68
- return (id, { getModuleInfo }) => {
69
- if (isInNodeModules(id) && !isCSSRequest(id) && staticImportedByEntry(id, getModuleInfo, cache.cache)) {
70
- return "vendor";
71
- }
72
- };
73
- }
74
- function staticImportedByEntry(id, getModuleInfo, cache, importStack = []) {
75
- if (cache.has(id)) {
76
- return cache.get(id);
77
- }
78
- if (importStack.includes(id)) {
79
- cache.set(id, false);
80
- return false;
81
- }
82
- const mod = getModuleInfo(id);
83
- if (!mod) {
84
- cache.set(id, false);
85
- return false;
86
- }
87
- if (mod.isEntry) {
88
- cache.set(id, true);
89
- return true;
90
- }
91
- const someImporterIs = mod.importers.some(
92
- (importer) => staticImportedByEntry(
93
- importer,
94
- getModuleInfo,
95
- cache,
96
- importStack.concat(id)
97
- )
98
- );
99
- cache.set(id, someImporterIs);
100
- return someImporterIs;
101
- }
102
- function splitVendorChunkPlugin() {
103
- const caches = [];
104
- function createSplitVendorChunk(output, config) {
105
- const cache = new SplitVendorChunkCache();
106
- caches.push(cache);
107
- const build = config.build ?? {};
108
- const format = output.format;
109
- if (!build.ssr && !build.lib && format !== "umd" && format !== "iife") {
110
- return splitVendorChunk({ cache });
111
- }
112
- }
113
- return {
114
- name: "vite:split-vendor-chunk",
115
- config(config) {
116
- let outputs = config.build?.rollupOptions?.output;
117
- if (outputs) {
118
- outputs = arraify(outputs);
119
- for (const output of outputs) {
120
- const viteManualChunks = createSplitVendorChunk(output, config);
121
- if (viteManualChunks) {
122
- if (output.manualChunks) {
123
- if (typeof output.manualChunks === "function") {
124
- const userManualChunks = output.manualChunks;
125
- output.manualChunks = (id, api) => {
126
- return userManualChunks(id, api) ?? viteManualChunks(id, api);
127
- };
128
- } else {
129
- console.warn(
130
- "(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.output.manualChunks`. Consider using the function form instead."
131
- );
132
- }
133
- } else {
134
- output.manualChunks = viteManualChunks;
135
- }
136
- }
137
- }
138
- } else {
139
- return {
140
- build: {
141
- rollupOptions: {
142
- output: {
143
- manualChunks: createSplitVendorChunk({}, config)
144
- }
145
- }
146
- }
147
- };
148
- }
149
- },
150
- buildStart() {
151
- caches.forEach((cache) => cache.reset());
152
- }
153
- };
154
- }
1
+ import { DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_EXTERNAL_CONDITIONS, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, VERSION, createLogger, defaultAllowedOrigins } from "./chunks/logger.js";
2
+ import { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, ssrTransform, transformWithEsbuild } from "./chunks/config.js";
3
+ import { parseAst, parseAstAsync } from "rollup/parseAst";
4
+ import { version as esbuildVersion } from "esbuild";
155
5
 
6
+ //#region src/node/server/environments/fetchableEnvironments.ts
156
7
  function createFetchableDevEnvironment(name, config, context) {
157
- if (typeof Request === "undefined" || typeof Response === "undefined") {
158
- throw new TypeError(
159
- "FetchableDevEnvironment requires a global `Request` and `Response` object."
160
- );
161
- }
162
- if (!context.handleRequest) {
163
- throw new TypeError(
164
- "FetchableDevEnvironment requires a `handleRequest` method during initialisation."
165
- );
166
- }
167
- return new FetchableDevEnvironment(name, config, context);
8
+ if (typeof Request === "undefined" || typeof Response === "undefined") throw new TypeError("FetchableDevEnvironment requires a global `Request` and `Response` object.");
9
+ if (!context.handleRequest) throw new TypeError("FetchableDevEnvironment requires a `handleRequest` method during initialisation.");
10
+ return new FetchableDevEnvironment(name, config, context);
168
11
  }
169
12
  function isFetchableDevEnvironment(environment) {
170
- return environment instanceof FetchableDevEnvironment;
171
- }
172
- class FetchableDevEnvironment extends DevEnvironment {
173
- _handleRequest;
174
- constructor(name, config, context) {
175
- super(name, config, context);
176
- this._handleRequest = context.handleRequest;
177
- }
178
- async dispatchFetch(request) {
179
- if (!(request instanceof Request)) {
180
- throw new TypeError(
181
- "FetchableDevEnvironment `dispatchFetch` must receive a `Request` object."
182
- );
183
- }
184
- const response = await this._handleRequest(request);
185
- if (!(response instanceof Response)) {
186
- throw new TypeError(
187
- "FetchableDevEnvironment `context.handleRequest` must return a `Response` object."
188
- );
189
- }
190
- return response;
191
- }
13
+ return environment instanceof FetchableDevEnvironment;
192
14
  }
15
+ var FetchableDevEnvironment = class extends DevEnvironment {
16
+ _handleRequest;
17
+ constructor(name, config, context) {
18
+ super(name, config, context);
19
+ this._handleRequest = context.handleRequest;
20
+ }
21
+ async dispatchFetch(request) {
22
+ if (!(request instanceof Request)) throw new TypeError("FetchableDevEnvironment `dispatchFetch` must receive a `Request` object.");
23
+ const response = await this._handleRequest(request);
24
+ if (!(response instanceof Response)) throw new TypeError("FetchableDevEnvironment `context.handleRequest` must return a `Response` object.");
25
+ return response;
26
+ }
27
+ };
193
28
 
194
- export { DevEnvironment, createFetchableDevEnvironment, isCSSRequest, isFetchableDevEnvironment, splitVendorChunk, splitVendorChunkPlugin };
29
+ //#endregion
30
+ export { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_EXTERNAL_CONDITIONS as defaultExternalConditions, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parseAst, parseAstAsync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, VERSION as version };