vite 3.0.0-alpha.0 → 3.0.0-alpha.11
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 +26 -4
- package/bin/vite.js +5 -5
- package/client.d.ts +16 -2
- package/dist/client/client.mjs +34 -20
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-a9015192.js → dep-17430d09.js} +20 -20
- package/dist/node/chunks/{dep-fafc4143.js → dep-46501b7a.js} +38000 -36456
- package/dist/node/chunks/{dep-2d9eaf08.js → dep-4e458630.js} +27 -29
- package/dist/node/chunks/{dep-63fe0f22.js → dep-d6e255b8.js} +111 -52
- package/dist/node/chunks/{dep-2056ae8a.js → dep-e8ca8d40.js} +9 -3
- package/dist/node/chunks/{dep-dfbd0b0c.js → dep-fb927717.js} +41 -37
- package/dist/node/cli.js +46 -48
- package/dist/node/constants.js +99 -0
- package/dist/node/index.d.ts +108 -17
- package/dist/node/index.js +38 -60
- package/dist/node-cjs/publicUtils.cjs +4174 -0
- package/index.cjs +33 -0
- package/package.json +48 -29
- package/src/client/client.ts +34 -17
- package/src/client/tsconfig.json +1 -1
- package/types/importGlob.d.ts +1 -3
- package/dist/node/terser.js +0 -32876
package/dist/node/index.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
require('worker_threads');
|
|
29
|
-
require('readline');
|
|
1
|
+
export { b as build, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, i as isDepsOptimizerEnabled, l as loadConfigFromFile, u as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, e as resolveConfig, v as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-46501b7a.js';
|
|
2
|
+
export { VERSION as version } from './constants.js';
|
|
3
|
+
import 'fs';
|
|
4
|
+
import 'path';
|
|
5
|
+
import 'url';
|
|
6
|
+
import 'perf_hooks';
|
|
7
|
+
import 'module';
|
|
8
|
+
import 'tty';
|
|
9
|
+
import 'esbuild';
|
|
10
|
+
import 'events';
|
|
11
|
+
import 'assert';
|
|
12
|
+
import 'resolve';
|
|
13
|
+
import 'util';
|
|
14
|
+
import 'net';
|
|
15
|
+
import 'http';
|
|
16
|
+
import 'stream';
|
|
17
|
+
import 'os';
|
|
18
|
+
import 'child_process';
|
|
19
|
+
import 'dns';
|
|
20
|
+
import 'crypto';
|
|
21
|
+
import 'buffer';
|
|
22
|
+
import 'querystring';
|
|
23
|
+
import 'zlib';
|
|
24
|
+
import 'https';
|
|
25
|
+
import 'tls';
|
|
26
|
+
import 'worker_threads';
|
|
27
|
+
import 'readline';
|
|
30
28
|
|
|
29
|
+
// This file will be built for both ESM and CJS. Avoid relying on other modules as possible.
|
|
30
|
+
const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`;
|
|
31
|
+
const cssLangRE = new RegExp(cssLangs);
|
|
32
|
+
const isCSSRequest = (request) => cssLangRE.test(request);
|
|
31
33
|
// Use splitVendorChunkPlugin() to get the same manualChunks strategy as Vite 2.7
|
|
32
34
|
// We don't recommend using this strategy as a general solution moving forward
|
|
33
35
|
// splitVendorChunk is a simple index/vendor strategy that was used in Vite
|
|
@@ -44,11 +46,10 @@ class SplitVendorChunkCache {
|
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
function splitVendorChunk(options = {}) {
|
|
47
|
-
|
|
48
|
-
const cache = (_a = options.cache) !== null && _a !== void 0 ? _a : new SplitVendorChunkCache();
|
|
49
|
+
const cache = options.cache ?? new SplitVendorChunkCache();
|
|
49
50
|
return (id, { getModuleInfo }) => {
|
|
50
51
|
if (id.includes('node_modules') &&
|
|
51
|
-
!
|
|
52
|
+
!isCSSRequest(id) &&
|
|
52
53
|
staticImportedByEntry(id, getModuleInfo, cache.cache)) {
|
|
53
54
|
return 'vendor';
|
|
54
55
|
}
|
|
@@ -79,11 +80,10 @@ function staticImportedByEntry(id, getModuleInfo, cache, importStack = []) {
|
|
|
79
80
|
function splitVendorChunkPlugin() {
|
|
80
81
|
const caches = [];
|
|
81
82
|
function createSplitVendorChunk(output, config) {
|
|
82
|
-
var _a;
|
|
83
83
|
const cache = new SplitVendorChunkCache();
|
|
84
84
|
caches.push(cache);
|
|
85
|
-
const build =
|
|
86
|
-
const format = output
|
|
85
|
+
const build = config.build ?? {};
|
|
86
|
+
const format = output?.format;
|
|
87
87
|
if (!build.ssr && !build.lib && format !== 'umd' && format !== 'iife') {
|
|
88
88
|
return splitVendorChunk({ cache });
|
|
89
89
|
}
|
|
@@ -91,8 +91,7 @@ function splitVendorChunkPlugin() {
|
|
|
91
91
|
return {
|
|
92
92
|
name: 'vite:split-vendor-chunk',
|
|
93
93
|
config(config) {
|
|
94
|
-
|
|
95
|
-
let outputs = (_b = (_a = config === null || config === void 0 ? void 0 : config.build) === null || _a === void 0 ? void 0 : _a.rollupOptions) === null || _b === void 0 ? void 0 : _b.output;
|
|
94
|
+
let outputs = config?.build?.rollupOptions?.output;
|
|
96
95
|
if (outputs) {
|
|
97
96
|
outputs = Array.isArray(outputs) ? outputs : [outputs];
|
|
98
97
|
for (const output of outputs) {
|
|
@@ -102,8 +101,7 @@ function splitVendorChunkPlugin() {
|
|
|
102
101
|
if (typeof output.manualChunks === 'function') {
|
|
103
102
|
const userManualChunks = output.manualChunks;
|
|
104
103
|
output.manualChunks = (id, api) => {
|
|
105
|
-
|
|
106
|
-
return (_a = userManualChunks(id, api)) !== null && _a !== void 0 ? _a : viteManualChunks(id, api);
|
|
104
|
+
return userManualChunks(id, api) ?? viteManualChunks(id, api);
|
|
107
105
|
};
|
|
108
106
|
}
|
|
109
107
|
// else, leave the object form of manualChunks untouched, as
|
|
@@ -133,24 +131,4 @@ function splitVendorChunkPlugin() {
|
|
|
133
131
|
};
|
|
134
132
|
}
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
exports.createLogger = index.createLogger;
|
|
138
|
-
exports.createServer = index.createServer;
|
|
139
|
-
exports.defineConfig = index.defineConfig;
|
|
140
|
-
exports.formatPostcssSourceMap = index.formatPostcssSourceMap;
|
|
141
|
-
exports.loadConfigFromFile = index.loadConfigFromFile;
|
|
142
|
-
exports.loadEnv = index.loadEnv;
|
|
143
|
-
exports.mergeConfig = index.mergeConfig;
|
|
144
|
-
exports.normalizePath = index.normalizePath;
|
|
145
|
-
exports.optimizeDeps = index.optimizeDeps;
|
|
146
|
-
exports.preview = index.preview;
|
|
147
|
-
exports.resolveConfig = index.resolveConfig;
|
|
148
|
-
exports.resolveEnvPrefix = index.resolveEnvPrefix;
|
|
149
|
-
exports.resolvePackageData = index.resolvePackageData;
|
|
150
|
-
exports.resolvePackageEntry = index.resolvePackageEntry;
|
|
151
|
-
exports.searchForWorkspaceRoot = index.searchForWorkspaceRoot;
|
|
152
|
-
exports.send = index.send;
|
|
153
|
-
exports.sortUserPlugins = index.sortUserPlugins;
|
|
154
|
-
exports.transformWithEsbuild = index.transformWithEsbuild;
|
|
155
|
-
exports.splitVendorChunk = splitVendorChunk;
|
|
156
|
-
exports.splitVendorChunkPlugin = splitVendorChunkPlugin;
|
|
134
|
+
export { splitVendorChunk, splitVendorChunkPlugin };
|