vite 5.0.0-beta.8 → 5.0.0-beta.9
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/dist/node/chunks/{dep-3accc834.js → dep-6d23b7fa.js} +1 -1
- package/dist/node/chunks/{dep-0b82e789.js → dep-e04185e5.js} +1 -1
- package/dist/node/chunks/{dep-73034a1b.js → dep-ffdf177d.js} +131 -58
- package/dist/node/cli.js +6 -6
- package/dist/node/index.d.ts +14 -0
- package/dist/node/index.js +3 -3
- package/dist/node-cjs/publicUtils.cjs +0 -6
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z as commonjsGlobal, y as getDefaultExportFromCjs } from './dep-
|
|
1
|
+
import { z as commonjsGlobal, y as getDefaultExportFromCjs } from './dep-ffdf177d.js';
|
|
2
2
|
import require$$0__default from 'fs';
|
|
3
3
|
import require$$0 from 'postcss';
|
|
4
4
|
import require$$0$1 from 'path';
|
|
@@ -12,6 +12,7 @@ import * as require$$0$2 from 'fs';
|
|
|
12
12
|
import require$$0__default, { existsSync, readFileSync, statSync as statSync$1, readdirSync } from 'fs';
|
|
13
13
|
import require$$0$5 from 'events';
|
|
14
14
|
import require$$5 from 'assert';
|
|
15
|
+
import { createServer as createServer$3, STATUS_CODES, get as get$1 } from 'node:http';
|
|
15
16
|
import require$$0$6 from 'util';
|
|
16
17
|
import require$$4$1 from 'net';
|
|
17
18
|
import require$$0$9 from 'url';
|
|
@@ -34,7 +35,6 @@ import { VERSION } from 'rollup';
|
|
|
34
35
|
import * as qs from 'querystring';
|
|
35
36
|
import readline from 'node:readline';
|
|
36
37
|
import { EventEmitter as EventEmitter$4 } from 'node:events';
|
|
37
|
-
import { createServer as createServer$3, STATUS_CODES } from 'node:http';
|
|
38
38
|
import { createServer as createServer$2 } from 'node:https';
|
|
39
39
|
import require$$0$a from 'zlib';
|
|
40
40
|
import require$$0$b from 'buffer';
|
|
@@ -12442,21 +12442,17 @@ function ensureWatchedFile(watcher, file, root) {
|
|
|
12442
12442
|
}
|
|
12443
12443
|
const escapedSpaceCharacters = /( |\\t|\\n|\\f|\\r)+/g;
|
|
12444
12444
|
const imageSetUrlRE = /^(?:[\w\-]+\(.*?\)|'.*?'|".*?"|\S*)/;
|
|
12445
|
-
function
|
|
12446
|
-
return ret.
|
|
12447
|
-
descriptor ??= '';
|
|
12448
|
-
return (prev +=
|
|
12449
|
-
url + ` ${descriptor}${index === ret.length - 1 ? '' : ', '}`);
|
|
12450
|
-
}, '');
|
|
12445
|
+
function joinSrcset(ret) {
|
|
12446
|
+
return ret.map(({ url, descriptor }) => `${url} ${descriptor}`).join(', ');
|
|
12451
12447
|
}
|
|
12452
12448
|
function splitSrcSetDescriptor(srcs) {
|
|
12453
12449
|
return splitSrcSet(srcs)
|
|
12454
12450
|
.map((s) => {
|
|
12455
12451
|
const src = s.replace(escapedSpaceCharacters, ' ').trim();
|
|
12456
|
-
const
|
|
12452
|
+
const url = imageSetUrlRE.exec(src)?.[0] ?? '';
|
|
12457
12453
|
return {
|
|
12458
12454
|
url,
|
|
12459
|
-
descriptor: src
|
|
12455
|
+
descriptor: src.slice(url.length).trim(),
|
|
12460
12456
|
};
|
|
12461
12457
|
})
|
|
12462
12458
|
.filter(({ url }) => !!url);
|
|
@@ -12465,10 +12461,10 @@ function processSrcSet(srcs, replacer) {
|
|
|
12465
12461
|
return Promise.all(splitSrcSetDescriptor(srcs).map(async ({ url, descriptor }) => ({
|
|
12466
12462
|
url: await replacer({ url, descriptor }),
|
|
12467
12463
|
descriptor,
|
|
12468
|
-
}))).then(
|
|
12464
|
+
}))).then(joinSrcset);
|
|
12469
12465
|
}
|
|
12470
12466
|
function processSrcSetSync(srcs, replacer) {
|
|
12471
|
-
return
|
|
12467
|
+
return joinSrcset(splitSrcSetDescriptor(srcs).map(({ url, descriptor }) => ({
|
|
12472
12468
|
url: replacer({ url, descriptor }),
|
|
12473
12469
|
descriptor,
|
|
12474
12470
|
})));
|
|
@@ -12666,12 +12662,6 @@ function arraify(target) {
|
|
|
12666
12662
|
const multilineCommentsRE$1 = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g;
|
|
12667
12663
|
const singlelineCommentsRE$1 = /\/\/.*/g;
|
|
12668
12664
|
const requestQuerySplitRE = /\?(?!.*[/|}])/;
|
|
12669
|
-
/**
|
|
12670
|
-
* Dynamically import files. It will make sure it's not being compiled away by TS/Rollup.
|
|
12671
|
-
*
|
|
12672
|
-
* @param file File path to import.
|
|
12673
|
-
*/
|
|
12674
|
-
const dynamicImport = new Function('file', 'return import(file)');
|
|
12675
12665
|
function parseRequest(id) {
|
|
12676
12666
|
const [_, search] = id.split(requestQuerySplitRE, 2);
|
|
12677
12667
|
if (!search) {
|
|
@@ -15517,8 +15507,8 @@ function assetPlugin(config) {
|
|
|
15517
15507
|
return;
|
|
15518
15508
|
}
|
|
15519
15509
|
id = id.replace(urlRE, '$1').replace(unnededFinalQueryCharRE, '');
|
|
15520
|
-
const url = await fileToUrl(id, config, this);
|
|
15521
|
-
return `export default ${JSON.stringify(url)}`;
|
|
15510
|
+
const url = await fileToUrl$1(id, config, this);
|
|
15511
|
+
return `export default ${JSON.stringify(config.command === 'serve' ? `${url}?t=${Date.now()}` : url)}`;
|
|
15522
15512
|
},
|
|
15523
15513
|
renderChunk(code, chunk, opts) {
|
|
15524
15514
|
const s = renderAssetUrlInJS(this, config, chunk, opts, code);
|
|
@@ -15568,7 +15558,7 @@ function checkPublicFile(url, { publicDir }) {
|
|
|
15568
15558
|
return;
|
|
15569
15559
|
}
|
|
15570
15560
|
}
|
|
15571
|
-
async function fileToUrl(id, config, ctx) {
|
|
15561
|
+
async function fileToUrl$1(id, config, ctx) {
|
|
15572
15562
|
if (config.command === 'serve') {
|
|
15573
15563
|
return fileToDevUrl(id, config);
|
|
15574
15564
|
}
|
|
@@ -37694,7 +37684,7 @@ function cssPlugin(config) {
|
|
|
37694
37684
|
}
|
|
37695
37685
|
const resolved = await resolveUrl(url, importer);
|
|
37696
37686
|
if (resolved) {
|
|
37697
|
-
return fileToUrl(resolved, config, this);
|
|
37687
|
+
return fileToUrl$1(resolved, config, this);
|
|
37698
37688
|
}
|
|
37699
37689
|
if (config.command === 'build') {
|
|
37700
37690
|
const isExternal = config.build.rollupOptions.external
|
|
@@ -37734,7 +37724,7 @@ function cssPlugin(config) {
|
|
|
37734
37724
|
for (const file of deps) {
|
|
37735
37725
|
depModules.add(isCSSRequest(file)
|
|
37736
37726
|
? moduleGraph.createFileOnlyEntry(file)
|
|
37737
|
-
: await moduleGraph.ensureEntryFromUrl(stripBase(await fileToUrl(file, config, this), (config.server?.origin ?? '') + devBase), ssr));
|
|
37727
|
+
: await moduleGraph.ensureEntryFromUrl(stripBase(await fileToUrl$1(file, config, this), (config.server?.origin ?? '') + devBase), ssr));
|
|
37738
37728
|
}
|
|
37739
37729
|
moduleGraph.updateModuleInfo(thisModule, depModules, null,
|
|
37740
37730
|
// The root CSS proxy module is self-accepting and should not
|
|
@@ -38420,8 +38410,8 @@ function createCachedImport(imp) {
|
|
|
38420
38410
|
return cached;
|
|
38421
38411
|
};
|
|
38422
38412
|
}
|
|
38423
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
|
38424
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
|
38413
|
+
const importPostcssImport = createCachedImport(() => import('./dep-e04185e5.js').then(function (n) { return n.i; }));
|
|
38414
|
+
const importPostcssModules = createCachedImport(() => import('./dep-6d23b7fa.js').then(function (n) { return n.i; }));
|
|
38425
38415
|
const importPostcss = createCachedImport(() => import('postcss'));
|
|
38426
38416
|
/**
|
|
38427
38417
|
* @experimental
|
|
@@ -41924,7 +41914,7 @@ const wasmHelperPlugin = (config) => {
|
|
|
41924
41914
|
if (!id.endsWith('.wasm?init')) {
|
|
41925
41915
|
return;
|
|
41926
41916
|
}
|
|
41927
|
-
const url = await fileToUrl(id, config, this);
|
|
41917
|
+
const url = await fileToUrl$1(id, config, this);
|
|
41928
41918
|
return `
|
|
41929
41919
|
import initWasm from "${wasmHelperId}"
|
|
41930
41920
|
export default opts => initWasm(opts, ${JSON.stringify(url)})
|
|
@@ -42216,7 +42206,7 @@ function webWorkerPlugin(config) {
|
|
|
42216
42206
|
}
|
|
42217
42207
|
}
|
|
42218
42208
|
else {
|
|
42219
|
-
url = await fileToUrl(cleanUrl(id), config, this);
|
|
42209
|
+
url = await fileToUrl$1(cleanUrl(id), config, this);
|
|
42220
42210
|
url = injectQuery(url, WORKER_FILE_ID);
|
|
42221
42211
|
url = injectQuery(url, `type=${workerType}`);
|
|
42222
42212
|
}
|
|
@@ -42624,7 +42614,7 @@ function workerImportMetaUrlPlugin(config) {
|
|
|
42624
42614
|
builtUrl = await workerFileToUrl(config, file, query);
|
|
42625
42615
|
}
|
|
42626
42616
|
else {
|
|
42627
|
-
builtUrl = await fileToUrl(cleanUrl(file), config, this);
|
|
42617
|
+
builtUrl = await fileToUrl$1(cleanUrl(file), config, this);
|
|
42628
42618
|
builtUrl = injectQuery(builtUrl, WORKER_FILE_ID);
|
|
42629
42619
|
builtUrl = injectQuery(builtUrl, `type=${workerType}`);
|
|
42630
42620
|
}
|
|
@@ -42737,10 +42727,10 @@ function assetImportMetaUrlPlugin(config) {
|
|
|
42737
42727
|
try {
|
|
42738
42728
|
if (isParentDirectory(normalizedPublicDir, file)) {
|
|
42739
42729
|
const publicPath = '/' + path$o.posix.relative(normalizedPublicDir, file);
|
|
42740
|
-
builtUrl = await fileToUrl(publicPath, config, this);
|
|
42730
|
+
builtUrl = await fileToUrl$1(publicPath, config, this);
|
|
42741
42731
|
}
|
|
42742
42732
|
else {
|
|
42743
|
-
builtUrl = await fileToUrl(file, config, this);
|
|
42733
|
+
builtUrl = await fileToUrl$1(file, config, this);
|
|
42744
42734
|
}
|
|
42745
42735
|
}
|
|
42746
42736
|
catch {
|
|
@@ -43006,14 +42996,17 @@ function parseDynamicImportPattern(strings) {
|
|
|
43006
42996
|
}
|
|
43007
42997
|
const [userPattern] = userPatternQuery.split(requestQuerySplitRE, 2);
|
|
43008
42998
|
const [rawPattern] = filename.split(requestQuerySplitRE, 2);
|
|
43009
|
-
|
|
43010
|
-
|
|
43011
|
-
|
|
43012
|
-
|
|
43013
|
-
|
|
42999
|
+
const as = ['worker', 'url', 'raw'].find((key) => rawQuery && key in rawQuery);
|
|
43000
|
+
if (as) {
|
|
43001
|
+
globParams = {
|
|
43002
|
+
as,
|
|
43003
|
+
import: '*',
|
|
43004
|
+
};
|
|
43014
43005
|
}
|
|
43015
|
-
if (rawQuery
|
|
43016
|
-
globParams = {
|
|
43006
|
+
else if (rawQuery) {
|
|
43007
|
+
globParams = {
|
|
43008
|
+
query: rawQuery,
|
|
43009
|
+
};
|
|
43017
43010
|
}
|
|
43018
43011
|
return {
|
|
43019
43012
|
globParams,
|
|
@@ -43035,9 +43028,7 @@ async function transformDynamicImport(importSource, importer, resolve, root) {
|
|
|
43035
43028
|
return null;
|
|
43036
43029
|
}
|
|
43037
43030
|
const { globParams, rawPattern, userPattern } = dynamicImportPattern;
|
|
43038
|
-
const params = globParams
|
|
43039
|
-
? `, ${JSON.stringify({ ...globParams, import: '*' })}`
|
|
43040
|
-
: '';
|
|
43031
|
+
const params = globParams ? `, ${JSON.stringify(globParams)}` : '';
|
|
43041
43032
|
let newRawPattern = posix$1.relative(posix$1.dirname(importer), await toAbsoluteGlob(rawPattern, root, importer, resolve));
|
|
43042
43033
|
if (!relativePathRE.test(newRawPattern)) {
|
|
43043
43034
|
newRawPattern = `./${newRawPattern}`;
|
|
@@ -55762,7 +55753,7 @@ async function nodeImport(id, importer, resolveOptions) {
|
|
|
55762
55753
|
}
|
|
55763
55754
|
url = pathToFileURL(resolved.id).toString();
|
|
55764
55755
|
}
|
|
55765
|
-
const mod = await
|
|
55756
|
+
const mod = await import(url);
|
|
55766
55757
|
return proxyESM(mod);
|
|
55767
55758
|
}
|
|
55768
55759
|
// rollup-style default import interop for cjs
|
|
@@ -64271,31 +64262,24 @@ const processNodeUrl = (url, useSrcSetReplacer, config, htmlPath, originalUrl, s
|
|
|
64271
64262
|
url = injectQuery(url, `t=${mod.lastHMRTimestamp}`);
|
|
64272
64263
|
}
|
|
64273
64264
|
}
|
|
64274
|
-
|
|
64275
|
-
|
|
64276
|
-
//
|
|
64277
|
-
|
|
64278
|
-
|
|
64279
|
-
|
|
64280
|
-
|
|
64281
|
-
|
|
64282
|
-
|
|
64283
|
-
else if ((url[0] === '.' || startsWithWordCharRE.test(url)) &&
|
|
64284
|
-
originalUrl &&
|
|
64285
|
-
originalUrl !== '/' &&
|
|
64286
|
-
htmlPath === '/index.html') {
|
|
64265
|
+
if ((url[0] === '/' && url[1] !== '/') ||
|
|
64266
|
+
// #3230 if some request url (localhost:3000/a/b) return to fallback html, the relative assets
|
|
64267
|
+
// path will add `/a/` prefix, it will caused 404.
|
|
64268
|
+
// rewrite before `./index.js` -> `localhost:5173/a/index.js`.
|
|
64269
|
+
// rewrite after `../index.js` -> `localhost:5173/index.js`.
|
|
64270
|
+
((url[0] === '.' || startsWithWordCharRE.test(url)) &&
|
|
64271
|
+
originalUrl &&
|
|
64272
|
+
originalUrl !== '/' &&
|
|
64273
|
+
htmlPath === '/index.html')) {
|
|
64287
64274
|
// prefix with base (dev only, base is never relative)
|
|
64288
64275
|
const replacer = (url) => {
|
|
64276
|
+
const devBase = config.base;
|
|
64289
64277
|
const fullUrl = path$o.posix.join(devBase, url);
|
|
64290
64278
|
if (server && shouldPreTransform(url, config)) {
|
|
64291
64279
|
preTransformRequest(server, fullUrl, devBase);
|
|
64292
64280
|
}
|
|
64293
64281
|
return fullUrl;
|
|
64294
64282
|
};
|
|
64295
|
-
// #3230 if some request url (localhost:3000/a/b) return to fallback html, the relative assets
|
|
64296
|
-
// path will add `/a/` prefix, it will caused 404.
|
|
64297
|
-
// rewrite before `./index.js` -> `localhost:5173/a/index.js`.
|
|
64298
|
-
// rewrite after `../index.js` -> `localhost:5173/index.js`.
|
|
64299
64283
|
const processedUrl = useSrcSetReplacer
|
|
64300
64284
|
? processSrcSetSync(url, ({ url }) => replacer(url))
|
|
64301
64285
|
: replacer(url);
|
|
@@ -64827,6 +64811,71 @@ class ModuleGraph {
|
|
|
64827
64811
|
}
|
|
64828
64812
|
}
|
|
64829
64813
|
|
|
64814
|
+
function warmupFiles(server) {
|
|
64815
|
+
const options = server.config.server.warmup;
|
|
64816
|
+
const root = server.config.root;
|
|
64817
|
+
if (options?.clientFiles?.length) {
|
|
64818
|
+
mapFiles(options.clientFiles, root).then((files) => {
|
|
64819
|
+
for (const file of files) {
|
|
64820
|
+
warmupFile(server, file, false);
|
|
64821
|
+
}
|
|
64822
|
+
});
|
|
64823
|
+
}
|
|
64824
|
+
if (options?.ssrFiles?.length) {
|
|
64825
|
+
mapFiles(options.ssrFiles, root).then((files) => {
|
|
64826
|
+
for (const file of files) {
|
|
64827
|
+
warmupFile(server, file, true);
|
|
64828
|
+
}
|
|
64829
|
+
});
|
|
64830
|
+
}
|
|
64831
|
+
}
|
|
64832
|
+
async function warmupFile(server, file, ssr) {
|
|
64833
|
+
try {
|
|
64834
|
+
// transform html with the `transformIndexHtml` hook as Vite internals would
|
|
64835
|
+
// pre-transform the imported JS modules linked. this may cause `transformIndexHtml`
|
|
64836
|
+
// plugins to be executed twice, but that's probably fine.
|
|
64837
|
+
if (file.endsWith('.html')) {
|
|
64838
|
+
const url = htmlFileToUrl(file, server.config.root);
|
|
64839
|
+
if (url) {
|
|
64840
|
+
const html = await fsp.readFile(file, 'utf-8');
|
|
64841
|
+
await server.transformIndexHtml(url, html);
|
|
64842
|
+
}
|
|
64843
|
+
}
|
|
64844
|
+
// for other files, pass it through `transformRequest`. this is what Vite uses
|
|
64845
|
+
// for it's `server.preTransformRequests` option.
|
|
64846
|
+
else {
|
|
64847
|
+
const url = fileToUrl(file, server.config.root);
|
|
64848
|
+
await server.transformRequest(url, { ssr });
|
|
64849
|
+
}
|
|
64850
|
+
}
|
|
64851
|
+
catch (e) {
|
|
64852
|
+
server.config.logger.error(colors$1.red(`Failed to warm up ${colors$1.cyan(file)}:\n`) + e.message);
|
|
64853
|
+
}
|
|
64854
|
+
}
|
|
64855
|
+
function htmlFileToUrl(file, root) {
|
|
64856
|
+
const url = path$o.relative(root, file);
|
|
64857
|
+
// out of root, ignore file
|
|
64858
|
+
if (url[0] === '.')
|
|
64859
|
+
return;
|
|
64860
|
+
// file within root, create root-relative url
|
|
64861
|
+
return '/' + normalizePath$3(url);
|
|
64862
|
+
}
|
|
64863
|
+
function fileToUrl(file, root) {
|
|
64864
|
+
const url = path$o.relative(root, file);
|
|
64865
|
+
// out of root, use /@fs/ prefix
|
|
64866
|
+
if (url[0] === '.') {
|
|
64867
|
+
return path$o.posix.join(FS_PREFIX, normalizePath$3(file));
|
|
64868
|
+
}
|
|
64869
|
+
// file within root, create root-relative url
|
|
64870
|
+
return '/' + normalizePath$3(url);
|
|
64871
|
+
}
|
|
64872
|
+
function mapFiles(files, root) {
|
|
64873
|
+
return glob(files, {
|
|
64874
|
+
cwd: root,
|
|
64875
|
+
absolute: true,
|
|
64876
|
+
});
|
|
64877
|
+
}
|
|
64878
|
+
|
|
64830
64879
|
function createServer(inlineConfig = {}) {
|
|
64831
64880
|
return _createServer(inlineConfig, { ws: true });
|
|
64832
64881
|
}
|
|
@@ -64907,6 +64956,29 @@ async function _createServer(inlineConfig = {}, options) {
|
|
|
64907
64956
|
const path = typeof options.open === 'string'
|
|
64908
64957
|
? new URL(options.open, url).href
|
|
64909
64958
|
: url;
|
|
64959
|
+
// We know the url that the browser would be opened to, so we can
|
|
64960
|
+
// start the request while we are awaiting the browser. This will
|
|
64961
|
+
// start the crawling of static imports ~500ms before.
|
|
64962
|
+
// preTransformRequests needs to be enabled for this optimization.
|
|
64963
|
+
if (server.config.server.preTransformRequests) {
|
|
64964
|
+
setTimeout(() => {
|
|
64965
|
+
get$1(path, {
|
|
64966
|
+
headers: {
|
|
64967
|
+
// Allow the history middleware to redirect to /index.html
|
|
64968
|
+
Accept: 'text/html',
|
|
64969
|
+
},
|
|
64970
|
+
}, (res) => {
|
|
64971
|
+
res.on('end', () => {
|
|
64972
|
+
// Ignore response, scripts discovered while processing the entry
|
|
64973
|
+
// will be preprocessed (server.config.server.preTransformRequests)
|
|
64974
|
+
});
|
|
64975
|
+
})
|
|
64976
|
+
.on('error', () => {
|
|
64977
|
+
// Ignore errors
|
|
64978
|
+
})
|
|
64979
|
+
.end();
|
|
64980
|
+
}, 0);
|
|
64981
|
+
}
|
|
64910
64982
|
openBrowser(path, true, server.config.logger);
|
|
64911
64983
|
}
|
|
64912
64984
|
else {
|
|
@@ -65110,6 +65182,7 @@ async function _createServer(inlineConfig = {}, options) {
|
|
|
65110
65182
|
if (isDepsOptimizerEnabled(config, false)) {
|
|
65111
65183
|
await initDepsOptimizer(config, server);
|
|
65112
65184
|
}
|
|
65185
|
+
warmupFiles(server);
|
|
65113
65186
|
initingServer = undefined;
|
|
65114
65187
|
serverInited = true;
|
|
65115
65188
|
})();
|
|
@@ -66097,7 +66170,7 @@ async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {
|
|
|
66097
66170
|
const fileUrl = `${pathToFileURL(fileBase)}.mjs`;
|
|
66098
66171
|
await fsp.writeFile(fileNameTmp, bundledCode);
|
|
66099
66172
|
try {
|
|
66100
|
-
return (await
|
|
66173
|
+
return (await import(fileUrl)).default;
|
|
66101
66174
|
}
|
|
66102
66175
|
finally {
|
|
66103
66176
|
fs$l.unlink(fileNameTmp, () => { }); // Ignore errors
|
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 { x as colors, k as createLogger, r as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { x as colors, k as createLogger, r as resolveConfig } from './chunks/dep-ffdf177d.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:url';
|
|
@@ -13,6 +13,7 @@ import 'esbuild';
|
|
|
13
13
|
import 'path';
|
|
14
14
|
import 'fs';
|
|
15
15
|
import 'assert';
|
|
16
|
+
import 'node:http';
|
|
16
17
|
import 'util';
|
|
17
18
|
import 'net';
|
|
18
19
|
import 'url';
|
|
@@ -34,7 +35,6 @@ import 'rollup';
|
|
|
34
35
|
import 'querystring';
|
|
35
36
|
import 'node:readline';
|
|
36
37
|
import 'node:events';
|
|
37
|
-
import 'node:http';
|
|
38
38
|
import 'node:https';
|
|
39
39
|
import 'zlib';
|
|
40
40
|
import 'buffer';
|
|
@@ -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-ffdf177d.js').then(function (n) { return n.C; });
|
|
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-ffdf177d.js').then(function (n) { return n.B; });
|
|
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-ffdf177d.js').then(function (n) { return n.A; });
|
|
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-ffdf177d.js').then(function (n) { return n.D; });
|
|
899
899
|
try {
|
|
900
900
|
const server = await preview({
|
|
901
901
|
root,
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1460,6 +1460,20 @@ interface ServerOptions extends CommonServerOptions {
|
|
|
1460
1460
|
* Configure HMR-specific options (port, host, path & protocol)
|
|
1461
1461
|
*/
|
|
1462
1462
|
hmr?: HmrOptions | boolean;
|
|
1463
|
+
/**
|
|
1464
|
+
* Warm-up files to transform and cache the results in advance. This improves the
|
|
1465
|
+
* initial page load during server starts and prevents transform waterfalls.
|
|
1466
|
+
*/
|
|
1467
|
+
warmup?: {
|
|
1468
|
+
/**
|
|
1469
|
+
* The files to be transformed and used on the client-side. Supports glob patterns.
|
|
1470
|
+
*/
|
|
1471
|
+
clientFiles?: string[];
|
|
1472
|
+
/**
|
|
1473
|
+
* The files to be transformed and used in SSR. Supports glob patterns.
|
|
1474
|
+
*/
|
|
1475
|
+
ssrFiles?: string[];
|
|
1476
|
+
};
|
|
1463
1477
|
/**
|
|
1464
1478
|
* chokidar watch options or null to disable FS watching
|
|
1465
1479
|
* https:
|
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, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, u as isFileServingAllowed, l as loadConfigFromFile, v as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, r as resolveConfig, w as resolveEnvPrefix, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
import { i as isInNodeModules } from './chunks/dep-ffdf177d.js';
|
|
2
|
+
export { b as build, e as buildErrorMessage, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, u as isFileServingAllowed, l as loadConfigFromFile, v as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, r as resolveConfig, w as resolveEnvPrefix, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-ffdf177d.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';
|
|
@@ -15,6 +15,7 @@ import 'path';
|
|
|
15
15
|
import 'fs';
|
|
16
16
|
import 'events';
|
|
17
17
|
import 'assert';
|
|
18
|
+
import 'node:http';
|
|
18
19
|
import 'util';
|
|
19
20
|
import 'net';
|
|
20
21
|
import 'url';
|
|
@@ -35,7 +36,6 @@ import 'node:v8';
|
|
|
35
36
|
import 'querystring';
|
|
36
37
|
import 'node:readline';
|
|
37
38
|
import 'node:events';
|
|
38
|
-
import 'node:http';
|
|
39
39
|
import 'node:https';
|
|
40
40
|
import 'zlib';
|
|
41
41
|
import 'buffer';
|
|
@@ -3487,12 +3487,6 @@ function isFileReadable(filename) {
|
|
|
3487
3487
|
function arraify(target) {
|
|
3488
3488
|
return Array.isArray(target) ? target : [target];
|
|
3489
3489
|
}
|
|
3490
|
-
/**
|
|
3491
|
-
* Dynamically import files. It will make sure it's not being compiled away by TS/Rollup.
|
|
3492
|
-
*
|
|
3493
|
-
* @param file File path to import.
|
|
3494
|
-
*/
|
|
3495
|
-
new Function('file', 'return import(file)');
|
|
3496
3490
|
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))));
|
|
3497
3491
|
function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
3498
3492
|
const merged = { ...defaults };
|