vite 4.2.0-beta.0 → 4.2.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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/dist/node/chunks/{dep-51508e52.js → dep-80b98891.js} +1 -1
- package/dist/node/chunks/{dep-ae3bb4e1.js → dep-84d7cc5e.js} +839 -516
- package/dist/node/cli.js +6 -5
- package/dist/node/index.d.ts +22 -0
- package/dist/node/index.js +2 -1
- package/dist/node-cjs/publicUtils.cjs +3 -3
- package/package.json +6 -6
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 { A as picocolorsExports, B as bindShortcuts, w as createLogger, h as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { A as picocolorsExports, B as bindShortcuts, w as createLogger, h as resolveConfig } from './chunks/dep-84d7cc5e.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'node:module';
|
|
@@ -25,6 +25,7 @@ import 'node:dns';
|
|
|
25
25
|
import 'resolve';
|
|
26
26
|
import 'crypto';
|
|
27
27
|
import 'node:buffer';
|
|
28
|
+
import 'node:fs/promises';
|
|
28
29
|
import 'module';
|
|
29
30
|
import 'node:assert';
|
|
30
31
|
import 'node:process';
|
|
@@ -728,7 +729,7 @@ cli
|
|
|
728
729
|
filterDuplicateOptions(options);
|
|
729
730
|
// output structure is preserved even after bundling so require()
|
|
730
731
|
// is ok here
|
|
731
|
-
const { createServer } = await import('./chunks/dep-
|
|
732
|
+
const { createServer } = await import('./chunks/dep-84d7cc5e.js').then(function (n) { return n.F; });
|
|
732
733
|
try {
|
|
733
734
|
const server = await createServer({
|
|
734
735
|
root,
|
|
@@ -806,7 +807,7 @@ cli
|
|
|
806
807
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
807
808
|
.action(async (root, options) => {
|
|
808
809
|
filterDuplicateOptions(options);
|
|
809
|
-
const { build } = await import('./chunks/dep-
|
|
810
|
+
const { build } = await import('./chunks/dep-84d7cc5e.js').then(function (n) { return n.E; });
|
|
810
811
|
const buildOptions = cleanOptions(options);
|
|
811
812
|
try {
|
|
812
813
|
await build({
|
|
@@ -834,7 +835,7 @@ cli
|
|
|
834
835
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
835
836
|
.action(async (root, options) => {
|
|
836
837
|
filterDuplicateOptions(options);
|
|
837
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
838
|
+
const { optimizeDeps } = await import('./chunks/dep-84d7cc5e.js').then(function (n) { return n.D; });
|
|
838
839
|
try {
|
|
839
840
|
const config = await resolveConfig({
|
|
840
841
|
root,
|
|
@@ -859,7 +860,7 @@ cli
|
|
|
859
860
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
860
861
|
.action(async (root, options) => {
|
|
861
862
|
filterDuplicateOptions(options);
|
|
862
|
-
const { preview } = await import('./chunks/dep-
|
|
863
|
+
const { preview } = await import('./chunks/dep-84d7cc5e.js').then(function (n) { return n.G; });
|
|
863
864
|
try {
|
|
864
865
|
const server = await preview({
|
|
865
866
|
root,
|
package/dist/node/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ import type { PluginHooks } from 'rollup';
|
|
|
48
48
|
import type * as PostCSS from 'postcss';
|
|
49
49
|
import { PrunePayload } from "../../types/hmrPayload";
|
|
50
50
|
import type { ResolveIdResult } from 'rollup';
|
|
51
|
+
import type * as Rollup from 'rollup';
|
|
51
52
|
import type { RollupError } from 'rollup';
|
|
52
53
|
import type { RollupOptions } from 'rollup';
|
|
53
54
|
import type { RollupOutput } from 'rollup';
|
|
@@ -194,6 +195,12 @@ export declare interface BuildOptions {
|
|
|
194
195
|
* @default target
|
|
195
196
|
*/
|
|
196
197
|
cssTarget?: EsbuildTransformOptions['target'] | false;
|
|
198
|
+
/**
|
|
199
|
+
* Override CSS minification specifically instead of defaulting to `build.minify`,
|
|
200
|
+
* so you can configure minification for JS and CSS separately.
|
|
201
|
+
* @default minify
|
|
202
|
+
*/
|
|
203
|
+
cssMinify?: boolean;
|
|
197
204
|
/**
|
|
198
205
|
* If `true`, a separate sourcemap file will be created. If 'inline', the
|
|
199
206
|
* sourcemap will be appended to the resulting output file as data URI.
|
|
@@ -1419,6 +1426,7 @@ export declare interface PackageData {
|
|
|
1419
1426
|
module: string;
|
|
1420
1427
|
browser: string | Record<string, string | false>;
|
|
1421
1428
|
exports: string | Record<string, any> | string[];
|
|
1429
|
+
imports: Record<string, any>;
|
|
1422
1430
|
dependencies: Record<string, string>;
|
|
1423
1431
|
};
|
|
1424
1432
|
}
|
|
@@ -1671,11 +1679,13 @@ export declare type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'asse
|
|
|
1671
1679
|
isWorker: boolean;
|
|
1672
1680
|
/* Excluded from this release type: mainConfig */
|
|
1673
1681
|
isProduction: boolean;
|
|
1682
|
+
envDir: string;
|
|
1674
1683
|
env: Record<string, any>;
|
|
1675
1684
|
resolve: Required<ResolveOptions> & {
|
|
1676
1685
|
alias: Alias[];
|
|
1677
1686
|
};
|
|
1678
1687
|
plugins: readonly Plugin_2[];
|
|
1688
|
+
esbuild: ESBuildOptions | false;
|
|
1679
1689
|
server: ResolvedServerOptions;
|
|
1680
1690
|
build: ResolvedBuildOptions;
|
|
1681
1691
|
preview: ResolvedPreviewOptions;
|
|
@@ -1701,6 +1711,7 @@ export declare interface ResolvedPreviewOptions extends PreviewOptions {
|
|
|
1701
1711
|
export declare interface ResolvedServerOptions extends ServerOptions {
|
|
1702
1712
|
fs: Required<FileSystemServeOptions>;
|
|
1703
1713
|
middlewareMode: boolean;
|
|
1714
|
+
sourcemapIgnoreList: Exclude<ServerOptions['sourcemapIgnoreList'], false | undefined>;
|
|
1704
1715
|
}
|
|
1705
1716
|
|
|
1706
1717
|
export declare interface ResolvedServerUrls {
|
|
@@ -1768,6 +1779,8 @@ export declare interface ResolveWorkerOptions extends PluginHookUtils {
|
|
|
1768
1779
|
rollupOptions: RollupOptions;
|
|
1769
1780
|
}
|
|
1770
1781
|
|
|
1782
|
+
export { Rollup }
|
|
1783
|
+
|
|
1771
1784
|
/**
|
|
1772
1785
|
* https://github.com/rollup/plugins/blob/master/packages/commonjs/types/index.d.ts
|
|
1773
1786
|
*
|
|
@@ -2070,6 +2083,15 @@ export declare interface ServerOptions extends CommonServerOptions {
|
|
|
2070
2083
|
* @default true
|
|
2071
2084
|
*/
|
|
2072
2085
|
preTransformRequests?: boolean;
|
|
2086
|
+
/**
|
|
2087
|
+
* Whether or not to ignore-list source files in the dev server sourcemap, used to populate
|
|
2088
|
+
* the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
|
|
2089
|
+
*
|
|
2090
|
+
* By default, it excludes all paths containing `node_modules`. You can pass `false` to
|
|
2091
|
+
* disable this behavior, or, for full control, a function that takes the source path and
|
|
2092
|
+
* sourcemap path and returns whether to ignore the source path.
|
|
2093
|
+
*/
|
|
2094
|
+
sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
|
|
2073
2095
|
/**
|
|
2074
2096
|
* Force dep pre-optimization regardless of whether deps have changed.
|
|
2075
2097
|
*
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as build, e as buildErrorMessage, u as createFilter, w as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, j as getDepOptimizationConfig, k as isDepsOptimizerEnabled, l as loadConfigFromFile, y as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, i as resolveBaseUrl, h as resolveConfig, z as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, x as searchForWorkspaceRoot, v as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
export { b as build, e as buildErrorMessage, u as createFilter, w as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, j as getDepOptimizationConfig, k as isDepsOptimizerEnabled, l as loadConfigFromFile, y as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, i as resolveBaseUrl, h as resolveConfig, z as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, x as searchForWorkspaceRoot, v as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-84d7cc5e.js';
|
|
2
2
|
export { VERSION as version } from './constants.js';
|
|
3
3
|
export { version as esbuildVersion } from 'esbuild';
|
|
4
4
|
export { VERSION as rollupVersion } from 'rollup';
|
|
@@ -26,6 +26,7 @@ import 'node:dns';
|
|
|
26
26
|
import 'resolve';
|
|
27
27
|
import 'crypto';
|
|
28
28
|
import 'node:buffer';
|
|
29
|
+
import 'node:fs/promises';
|
|
29
30
|
import 'module';
|
|
30
31
|
import 'node:assert';
|
|
31
32
|
import 'node:process';
|
|
@@ -16,11 +16,11 @@ var require$$1$1 = require('fs');
|
|
|
16
16
|
var readline = require('node:readline');
|
|
17
17
|
var require$$2 = require('os');
|
|
18
18
|
|
|
19
|
-
const { version: version$2 } = JSON.parse(fs$1.readFileSync(new URL('../../package.json', (typeof document === 'undefined' ?
|
|
19
|
+
const { version: version$2 } = JSON.parse(fs$1.readFileSync(new URL('../../package.json', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)))).toString());
|
|
20
20
|
const VERSION = version$2;
|
|
21
21
|
const VITE_PACKAGE_DIR = path$3.resolve(
|
|
22
22
|
// import.meta.url is `dist/node/constants.js` after bundle
|
|
23
|
-
node_url.fileURLToPath((typeof document === 'undefined' ?
|
|
23
|
+
node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href))), '../../..');
|
|
24
24
|
const CLIENT_ENTRY = path$3.resolve(VITE_PACKAGE_DIR, 'dist/client/client.mjs');
|
|
25
25
|
path$3.resolve(VITE_PACKAGE_DIR, 'dist/client/env.mjs');
|
|
26
26
|
path$3.dirname(CLIENT_ENTRY);
|
|
@@ -3408,7 +3408,7 @@ function slash(p) {
|
|
|
3408
3408
|
return p.replace(/\\/g, '/');
|
|
3409
3409
|
}
|
|
3410
3410
|
// TODO: use import()
|
|
3411
|
-
const _require = node_module.createRequire((typeof document === 'undefined' ?
|
|
3411
|
+
const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('node-cjs/publicUtils.cjs', document.baseURI).href)));
|
|
3412
3412
|
try {
|
|
3413
3413
|
Boolean(_require('pnpapi'));
|
|
3414
3414
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "4.2.0-beta.
|
|
3
|
+
"version": "4.2.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"esbuild": "^0.17.5",
|
|
70
70
|
"postcss": "^8.4.21",
|
|
71
71
|
"resolve": "^1.22.1",
|
|
72
|
-
"rollup": "^3.
|
|
72
|
+
"rollup": "^3.18.0"
|
|
73
73
|
},
|
|
74
74
|
"optionalDependencies": {
|
|
75
75
|
"fsevents": "~2.3.2"
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"dep-types": "link:./src/types",
|
|
100
100
|
"dotenv": "^16.0.3",
|
|
101
101
|
"dotenv-expand": "^9.0.0",
|
|
102
|
-
"es-module-lexer": "1.
|
|
102
|
+
"es-module-lexer": "^1.2.0",
|
|
103
103
|
"estree-walker": "^3.0.3",
|
|
104
104
|
"etag": "^1.8.1",
|
|
105
105
|
"fast-glob": "^3.2.12",
|
|
@@ -119,17 +119,17 @@
|
|
|
119
119
|
"postcss-import": "^15.1.0",
|
|
120
120
|
"postcss-load-config": "^4.0.1",
|
|
121
121
|
"postcss-modules": "^6.0.0",
|
|
122
|
-
"resolve.exports": "^2.0.
|
|
122
|
+
"resolve.exports": "^2.0.1",
|
|
123
123
|
"rollup-plugin-license": "^3.0.1",
|
|
124
124
|
"sirv": "^2.0.2",
|
|
125
125
|
"source-map-js": "^1.0.2",
|
|
126
126
|
"source-map-support": "^0.5.21",
|
|
127
127
|
"strip-ansi": "^7.0.1",
|
|
128
128
|
"strip-literal": "^1.0.1",
|
|
129
|
-
"tsconfck": "^2.0
|
|
129
|
+
"tsconfck": "^2.1.0",
|
|
130
130
|
"tslib": "^2.5.0",
|
|
131
131
|
"types": "link:./types",
|
|
132
|
-
"ufo": "^1.1.
|
|
132
|
+
"ufo": "^1.1.1",
|
|
133
133
|
"ws": "^8.12.1"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|