vite 5.0.0-beta.4 → 5.0.0-beta.6
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/LICENSE.md +45 -1
- package/dist/client/client.mjs.map +1 -1
- package/dist/client/env.mjs.map +1 -1
- package/dist/node/chunks/{dep-ae1dfb84.js → dep-c3c41c00.js} +1 -1
- package/dist/node/chunks/{dep-a86a117b.js → dep-ce41d4ea.js} +1 -1
- package/dist/node/chunks/{dep-69dc786c.js → dep-db07a1ea.js} +529 -326
- package/dist/node/cli.js +5 -5
- package/dist/node/index.d.ts +16 -7
- package/dist/node/index.js +2 -2
- package/dist/node-cjs/publicUtils.cjs +22 -11
- package/package.json +15 -15
package/dist/node/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { performance } from 'node:perf_hooks';
|
|
4
4
|
import { EventEmitter } from 'events';
|
|
5
|
-
import { C as colors, x as createLogger, h as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { C as colors, x as createLogger, h as resolveConfig } from './chunks/dep-db07a1ea.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:url';
|
|
@@ -759,7 +759,7 @@ cli
|
|
|
759
759
|
filterDuplicateOptions(options);
|
|
760
760
|
// output structure is preserved even after bundling so require()
|
|
761
761
|
// is ok here
|
|
762
|
-
const { createServer } = await import('./chunks/dep-
|
|
762
|
+
const { createServer } = await import('./chunks/dep-db07a1ea.js').then(function (n) { return n.H; });
|
|
763
763
|
try {
|
|
764
764
|
const server = await createServer({
|
|
765
765
|
root,
|
|
@@ -840,7 +840,7 @@ cli
|
|
|
840
840
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
841
841
|
.action(async (root, options) => {
|
|
842
842
|
filterDuplicateOptions(options);
|
|
843
|
-
const { build } = await import('./chunks/dep-
|
|
843
|
+
const { build } = await import('./chunks/dep-db07a1ea.js').then(function (n) { return n.G; });
|
|
844
844
|
const buildOptions = cleanOptions(options);
|
|
845
845
|
try {
|
|
846
846
|
await build({
|
|
@@ -868,7 +868,7 @@ cli
|
|
|
868
868
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
869
869
|
.action(async (root, options) => {
|
|
870
870
|
filterDuplicateOptions(options);
|
|
871
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
871
|
+
const { optimizeDeps } = await import('./chunks/dep-db07a1ea.js').then(function (n) { return n.F; });
|
|
872
872
|
try {
|
|
873
873
|
const config = await resolveConfig({
|
|
874
874
|
root,
|
|
@@ -895,7 +895,7 @@ cli
|
|
|
895
895
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
896
896
|
.action(async (root, options) => {
|
|
897
897
|
filterDuplicateOptions(options);
|
|
898
|
-
const { preview } = await import('./chunks/dep-
|
|
898
|
+
const { preview } = await import('./chunks/dep-db07a1ea.js').then(function (n) { return n.I; });
|
|
899
899
|
try {
|
|
900
900
|
const server = await preview({
|
|
901
901
|
root,
|
package/dist/node/index.d.ts
CHANGED
|
@@ -2194,13 +2194,6 @@ export declare interface ServerOptions extends CommonServerOptions {
|
|
|
2194
2194
|
* sourcemap path and returns whether to ignore the source path.
|
|
2195
2195
|
*/
|
|
2196
2196
|
sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
|
|
2197
|
-
/**
|
|
2198
|
-
* Force dep pre-optimization regardless of whether deps have changed.
|
|
2199
|
-
*
|
|
2200
|
-
* @deprecated Use optimizeDeps.force instead, this option may be removed
|
|
2201
|
-
* in a future minor version without following semver
|
|
2202
|
-
*/
|
|
2203
|
-
force?: boolean;
|
|
2204
2197
|
}
|
|
2205
2198
|
|
|
2206
2199
|
export declare function sortUserPlugins(plugins: (Plugin_2 | Plugin_2[])[] | undefined): [Plugin_2[], Plugin_2[], Plugin_2[]];
|
|
@@ -2237,6 +2230,22 @@ export declare interface SSROptions {
|
|
|
2237
2230
|
* @experimental
|
|
2238
2231
|
*/
|
|
2239
2232
|
optimizeDeps?: SsrDepOptimizationOptions;
|
|
2233
|
+
resolve?: {
|
|
2234
|
+
/**
|
|
2235
|
+
* Conditions that are used in the plugin pipeline. The default value is the root config's `resolve.conditions`.
|
|
2236
|
+
*
|
|
2237
|
+
* Use this to override the default ssr conditions for the ssr build.
|
|
2238
|
+
*
|
|
2239
|
+
* @default rootConfig.resolve.conditions
|
|
2240
|
+
*/
|
|
2241
|
+
conditions?: string[];
|
|
2242
|
+
/**
|
|
2243
|
+
* Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
|
|
2244
|
+
*
|
|
2245
|
+
* @default []
|
|
2246
|
+
*/
|
|
2247
|
+
externalConditions?: string[];
|
|
2248
|
+
};
|
|
2240
2249
|
}
|
|
2241
2250
|
|
|
2242
2251
|
export declare type SSRTarget = 'node' | 'webworker';
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as isInNodeModules } from './chunks/dep-
|
|
2
|
-
export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
import { i as isInNodeModules } from './chunks/dep-db07a1ea.js';
|
|
2
|
+
export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-db07a1ea.js';
|
|
3
3
|
export { VERSION as version } from './constants.js';
|
|
4
4
|
export { version as esbuildVersion } from 'esbuild';
|
|
5
5
|
export { VERSION as rollupVersion } from 'rollup';
|
|
@@ -3374,7 +3374,7 @@ function isInNodeModules(id) {
|
|
|
3374
3374
|
return id.includes('node_modules');
|
|
3375
3375
|
}
|
|
3376
3376
|
// TODO: use import()
|
|
3377
|
-
|
|
3377
|
+
node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)));
|
|
3378
3378
|
// set in bin/vite.js
|
|
3379
3379
|
const filter = process.env.VITE_DEBUG_FILTER;
|
|
3380
3380
|
const DEBUG = process.env.DEBUG;
|
|
@@ -3487,20 +3487,12 @@ function isFileReadable(filename) {
|
|
|
3487
3487
|
function arraify(target) {
|
|
3488
3488
|
return Array.isArray(target) ? target : [target];
|
|
3489
3489
|
}
|
|
3490
|
-
// @ts-expect-error jest only exists when running Jest
|
|
3491
|
-
const usingDynamicImport = typeof jest === 'undefined';
|
|
3492
3490
|
/**
|
|
3493
3491
|
* Dynamically import files. It will make sure it's not being compiled away by TS/Rollup.
|
|
3494
3492
|
*
|
|
3495
|
-
* As a temporary workaround for Jest's lack of stable ESM support, we fallback to require
|
|
3496
|
-
* if we're in a Jest environment.
|
|
3497
|
-
* See https://github.com/vitejs/vite/pull/5197#issuecomment-938054077
|
|
3498
|
-
*
|
|
3499
3493
|
* @param file File path to import.
|
|
3500
3494
|
*/
|
|
3501
|
-
|
|
3502
|
-
? new Function('file', 'return import(file)')
|
|
3503
|
-
: _require;
|
|
3495
|
+
new Function('file', 'return import(file)');
|
|
3504
3496
|
path$3.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))));
|
|
3505
3497
|
function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
3506
3498
|
const merged = { ...defaults };
|
|
@@ -4379,16 +4371,35 @@ class Mappings {
|
|
|
4379
4371
|
|
|
4380
4372
|
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
4381
4373
|
if (content.length) {
|
|
4374
|
+
let contentLineEnd = content.indexOf('\n', 0);
|
|
4375
|
+
let previousContentLineEnd = -1;
|
|
4376
|
+
while (contentLineEnd >= 0) {
|
|
4377
|
+
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
4378
|
+
if (nameIndex >= 0) {
|
|
4379
|
+
segment.push(nameIndex);
|
|
4380
|
+
}
|
|
4381
|
+
this.rawSegments.push(segment);
|
|
4382
|
+
|
|
4383
|
+
this.generatedCodeLine += 1;
|
|
4384
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
4385
|
+
this.generatedCodeColumn = 0;
|
|
4386
|
+
|
|
4387
|
+
previousContentLineEnd = contentLineEnd;
|
|
4388
|
+
contentLineEnd = content.indexOf('\n', contentLineEnd + 1);
|
|
4389
|
+
}
|
|
4390
|
+
|
|
4382
4391
|
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
4383
4392
|
if (nameIndex >= 0) {
|
|
4384
4393
|
segment.push(nameIndex);
|
|
4385
4394
|
}
|
|
4386
4395
|
this.rawSegments.push(segment);
|
|
4396
|
+
|
|
4397
|
+
this.advance(content.slice(previousContentLineEnd + 1));
|
|
4387
4398
|
} else if (this.pending) {
|
|
4388
4399
|
this.rawSegments.push(this.pending);
|
|
4400
|
+
this.advance(content);
|
|
4389
4401
|
}
|
|
4390
4402
|
|
|
4391
|
-
this.advance(content);
|
|
4392
4403
|
this.pending = null;
|
|
4393
4404
|
}
|
|
4394
4405
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"esbuild": "^0.19.3",
|
|
65
|
-
"postcss": "^8.4.
|
|
65
|
+
"postcss": "^8.4.31",
|
|
66
66
|
"rollup": "^3.29.2"
|
|
67
67
|
},
|
|
68
68
|
"optionalDependencies": {
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@ampproject/remapping": "^2.2.1",
|
|
73
|
-
"@babel/parser": "^7.
|
|
74
|
-
"@babel/types": "^7.
|
|
73
|
+
"@babel/parser": "^7.23.0",
|
|
74
|
+
"@babel/types": "^7.23.0",
|
|
75
75
|
"@jridgewell/trace-mapping": "^0.3.19",
|
|
76
|
-
"@rollup/plugin-alias": "^5.0.
|
|
77
|
-
"@rollup/plugin-commonjs": "^25.0.
|
|
78
|
-
"@rollup/plugin-dynamic-import-vars": "^2.0.
|
|
79
|
-
"@rollup/plugin-json": "^6.0.
|
|
80
|
-
"@rollup/plugin-node-resolve": "15.2.
|
|
81
|
-
"@rollup/plugin-typescript": "^11.1.
|
|
82
|
-
"@rollup/pluginutils": "^5.0.
|
|
76
|
+
"@rollup/plugin-alias": "^5.0.1",
|
|
77
|
+
"@rollup/plugin-commonjs": "^25.0.5",
|
|
78
|
+
"@rollup/plugin-dynamic-import-vars": "^2.0.6",
|
|
79
|
+
"@rollup/plugin-json": "^6.0.1",
|
|
80
|
+
"@rollup/plugin-node-resolve": "15.2.3",
|
|
81
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
82
|
+
"@rollup/pluginutils": "^5.0.5",
|
|
83
83
|
"@types/escape-html": "^1.0.2",
|
|
84
84
|
"@types/pnpapi": "^0.0.3",
|
|
85
85
|
"acorn": "^8.10.0",
|
|
@@ -103,9 +103,9 @@
|
|
|
103
103
|
"fast-glob": "^3.3.1",
|
|
104
104
|
"http-proxy": "^1.18.1",
|
|
105
105
|
"json-stable-stringify": "^1.0.2",
|
|
106
|
-
"launch-editor-middleware": "^2.6.
|
|
106
|
+
"launch-editor-middleware": "^2.6.1",
|
|
107
107
|
"lightningcss": "^1.22.0",
|
|
108
|
-
"magic-string": "^0.30.
|
|
108
|
+
"magic-string": "^0.30.4",
|
|
109
109
|
"micromatch": "^4.0.5",
|
|
110
110
|
"mlly": "^1.4.2",
|
|
111
111
|
"mrmime": "^1.0.1",
|
|
@@ -124,10 +124,10 @@
|
|
|
124
124
|
"source-map-support": "^0.5.21",
|
|
125
125
|
"strip-ansi": "^7.1.0",
|
|
126
126
|
"strip-literal": "^1.3.0",
|
|
127
|
-
"tsconfck": "^3.0.0-next.
|
|
127
|
+
"tsconfck": "^3.0.0-next.9",
|
|
128
128
|
"tslib": "^2.6.2",
|
|
129
129
|
"types": "link:./types",
|
|
130
|
-
"ufo": "^1.3.
|
|
130
|
+
"ufo": "^1.3.1",
|
|
131
131
|
"ws": "^8.14.2"
|
|
132
132
|
},
|
|
133
133
|
"peerDependencies": {
|