vite 5.3.0-beta.0 → 5.3.0-beta.1
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-BPjeYeh_.js → dep-ByQDP9Ky.js} +1 -1
- package/dist/node/chunks/{dep-CTAUzmEN.js → dep-Cg_8Tny5.js} +1 -1
- package/dist/node/chunks/{dep-BBErwUJM.js → dep-Dz0We6of.js} +205 -34
- package/dist/node/cli.js +5 -5
- package/dist/node/index.js +2 -2
- package/dist/node-cjs/publicUtils.cjs +2 -2
- package/package.json +4 -4
@@ -1,4 +1,4 @@
|
|
1
|
-
import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-Dz0We6of.js';
|
2
2
|
import require$$0__default from 'fs';
|
3
3
|
import require$$0 from 'postcss';
|
4
4
|
import require$$0$1 from 'path';
|
@@ -11818,11 +11818,11 @@ function requireNode$1 () {
|
|
11818
11818
|
}
|
11819
11819
|
|
11820
11820
|
/**
|
11821
|
-
* Invokes `util.
|
11821
|
+
* Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
|
11822
11822
|
*/
|
11823
11823
|
|
11824
11824
|
function log(...args) {
|
11825
|
-
return process.stderr.write(util.
|
11825
|
+
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
|
11826
11826
|
}
|
11827
11827
|
|
11828
11828
|
/**
|
@@ -13920,6 +13920,20 @@ function pattern2regex(resolvedPattern, allowJs) {
|
|
13920
13920
|
return new RegExp(regexStr);
|
13921
13921
|
}
|
13922
13922
|
|
13923
|
+
/**
|
13924
|
+
* replace tokens like ${configDir}
|
13925
|
+
* @param {any} tsconfig
|
13926
|
+
* @param {string} configDir
|
13927
|
+
* @returns {any}
|
13928
|
+
*/
|
13929
|
+
function replaceTokens(tsconfig, configDir) {
|
13930
|
+
return JSON.parse(
|
13931
|
+
JSON.stringify(tsconfig)
|
13932
|
+
// replace ${configDir}, accounting for rebaseRelative emitted ../${configDir}
|
13933
|
+
.replaceAll(/"(?:\.\.\/)*\${configDir}/g, `"${native2posix(configDir)}`)
|
13934
|
+
);
|
13935
|
+
}
|
13936
|
+
|
13923
13937
|
/**
|
13924
13938
|
* find the closest tsconfig.json file
|
13925
13939
|
*
|
@@ -14280,7 +14294,8 @@ function normalizeTSConfig(tsconfig, dir) {
|
|
14280
14294
|
if (tsconfig.compilerOptions?.baseUrl && !path$o.isAbsolute(tsconfig.compilerOptions.baseUrl)) {
|
14281
14295
|
tsconfig.compilerOptions.baseUrl = resolve2posix(dir, tsconfig.compilerOptions.baseUrl);
|
14282
14296
|
}
|
14283
|
-
|
14297
|
+
|
14298
|
+
return replaceTokens(tsconfig, dir);
|
14284
14299
|
}
|
14285
14300
|
|
14286
14301
|
/**
|
@@ -31528,6 +31543,7 @@ function getAttrSourceCodeLocation(node, attrKey) {
|
|
31528
31543
|
return node.sourceCodeLocation.attrs[attrKey];
|
31529
31544
|
}
|
31530
31545
|
|
31546
|
+
const decoder = new TextDecoder();
|
31531
31547
|
function resolveCSSOptions(options) {
|
31532
31548
|
if (options?.transformer === 'lightningcss') {
|
31533
31549
|
return {
|
@@ -32436,8 +32452,8 @@ function createCachedImport(imp) {
|
|
32436
32452
|
return cached;
|
32437
32453
|
};
|
32438
32454
|
}
|
32439
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
32440
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
32455
|
+
const importPostcssImport = createCachedImport(() => import('./dep-ByQDP9Ky.js').then(function (n) { return n.i; }));
|
32456
|
+
const importPostcssModules = createCachedImport(() => import('./dep-Cg_8Tny5.js').then(function (n) { return n.i; }));
|
32441
32457
|
const importPostcss = createCachedImport(() => import('postcss'));
|
32442
32458
|
const preprocessorWorkerControllerCache = new WeakMap();
|
32443
32459
|
let alwaysFakeWorkerWorkerControllerCache;
|
@@ -32678,8 +32694,11 @@ async function minifyCSS(css, config, inlined) {
|
|
32678
32694
|
.map((w) => w.message)
|
32679
32695
|
.join('\n')}`));
|
32680
32696
|
}
|
32697
|
+
// NodeJS res.code = Buffer
|
32698
|
+
// Deno res.code = Uint8Array
|
32699
|
+
// For correct decode compiled css need to use TextDecoder
|
32681
32700
|
// LightningCSS output does not return a linebreak at the end
|
32682
|
-
return
|
32701
|
+
return decoder.decode(code) + (inlined ? '' : '\n');
|
32683
32702
|
}
|
32684
32703
|
try {
|
32685
32704
|
const { code, warnings } = await transform$2(css, {
|
@@ -32815,6 +32834,7 @@ function fixScssBugImportValue(data) {
|
|
32815
32834
|
}
|
32816
32835
|
return data;
|
32817
32836
|
}
|
32837
|
+
// #region Sass
|
32818
32838
|
// .scss/.sass processor
|
32819
32839
|
const makeScssWorker = (resolvers, alias, maxWorkers) => {
|
32820
32840
|
const internalImporter = async (url, importer, filename) => {
|
@@ -32934,6 +32954,7 @@ const scssProcessor = (maxWorkers) => {
|
|
32934
32954
|
},
|
32935
32955
|
};
|
32936
32956
|
};
|
32957
|
+
// #endregion
|
32937
32958
|
/**
|
32938
32959
|
* relative url() inside \@imported sass and less files must be rebased to use
|
32939
32960
|
* root file as base.
|
@@ -32989,6 +33010,7 @@ async function rebaseUrls(file, rootFile, alias, variablePrefix, resolver) {
|
|
32989
33010
|
contents: rebased,
|
32990
33011
|
};
|
32991
33012
|
}
|
33013
|
+
// #region Less
|
32992
33014
|
// .less
|
32993
33015
|
const makeLessWorker = (resolvers, alias, maxWorkers) => {
|
32994
33016
|
const viteLessResolve = async (filename, dir, rootFile) => {
|
@@ -33123,6 +33145,8 @@ const lessProcessor = (maxWorkers) => {
|
|
33123
33145
|
},
|
33124
33146
|
};
|
33125
33147
|
};
|
33148
|
+
// #endregion
|
33149
|
+
// #region Stylus
|
33126
33150
|
// .styl
|
33127
33151
|
const makeStylWorker = (maxWorkers) => {
|
33128
33152
|
const worker = new WorkerWithFallback(() => {
|
@@ -33216,6 +33240,7 @@ function formatStylusSourceMap(mapBefore, root) {
|
|
33216
33240
|
map.sources = map.sources.map(resolveFromRoot);
|
33217
33241
|
return map;
|
33218
33242
|
}
|
33243
|
+
// #endregion
|
33219
33244
|
async function getSource(source, filename, additionalData, enableSourcemap, sep = '') {
|
33220
33245
|
if (!additionalData)
|
33221
33246
|
return { content: source };
|
@@ -33279,7 +33304,6 @@ function isPreProcessor(lang) {
|
|
33279
33304
|
return lang && preprocessorSet.has(lang);
|
33280
33305
|
}
|
33281
33306
|
const importLightningCSS = createCachedImport(() => import('lightningcss'));
|
33282
|
-
const decoder = new TextDecoder();
|
33283
33307
|
async function compileLightningCSS(id, src, config, urlReplacer) {
|
33284
33308
|
const deps = new Set();
|
33285
33309
|
// Relative path is needed to get stable hash when using CSS modules
|
@@ -33345,6 +33369,9 @@ async function compileLightningCSS(id, src, config, urlReplacer) {
|
|
33345
33369
|
const replaceUrl = await urlReplacer(dep.url, id);
|
33346
33370
|
css = css.replace(dep.placeholder, () => replaceUrl);
|
33347
33371
|
}
|
33372
|
+
else {
|
33373
|
+
css = css.replace(dep.placeholder, () => dep.url);
|
33374
|
+
}
|
33348
33375
|
break;
|
33349
33376
|
default:
|
33350
33377
|
throw new Error(`Unsupported dependency type: ${dep.type}`);
|
@@ -49838,9 +49865,9 @@ function ssrFixStacktrace(e, moduleGraph) {
|
|
49838
49865
|
}
|
49839
49866
|
|
49840
49867
|
const pendingModules = new Map();
|
49841
|
-
const
|
49868
|
+
const pendingModuleDependencyGraph = new Map();
|
49842
49869
|
const importErrors = new WeakMap();
|
49843
|
-
async function ssrLoadModule(url, server, context = { global },
|
49870
|
+
async function ssrLoadModule(url, server, context = { global }, fixStacktrace) {
|
49844
49871
|
url = unwrapId$1(url);
|
49845
49872
|
// when we instantiate multiple dependency modules in parallel, they may
|
49846
49873
|
// point to shared modules. We need to avoid duplicate instantiation attempts
|
@@ -49850,18 +49877,18 @@ async function ssrLoadModule(url, server, context = { global }, urlStack = [], f
|
|
49850
49877
|
if (pending) {
|
49851
49878
|
return pending;
|
49852
49879
|
}
|
49853
|
-
const modulePromise = instantiateModule(url, server, context,
|
49880
|
+
const modulePromise = instantiateModule(url, server, context, fixStacktrace);
|
49854
49881
|
pendingModules.set(url, modulePromise);
|
49855
49882
|
modulePromise
|
49856
49883
|
.catch(() => {
|
49857
|
-
|
49884
|
+
/* prevent unhandled promise rejection error from bubbling up */
|
49858
49885
|
})
|
49859
49886
|
.finally(() => {
|
49860
49887
|
pendingModules.delete(url);
|
49861
49888
|
});
|
49862
49889
|
return modulePromise;
|
49863
49890
|
}
|
49864
|
-
async function instantiateModule(url, server, context = { global },
|
49891
|
+
async function instantiateModule(url, server, context = { global }, fixStacktrace) {
|
49865
49892
|
const { moduleGraph } = server;
|
49866
49893
|
const mod = await moduleGraph.ensureEntryFromUrl(url, true);
|
49867
49894
|
if (mod.ssrError) {
|
@@ -49891,8 +49918,6 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
|
|
49891
49918
|
// The filesystem URL, matching native Node.js modules
|
49892
49919
|
url: pathToFileURL(mod.file).toString(),
|
49893
49920
|
};
|
49894
|
-
urlStack = urlStack.concat(url);
|
49895
|
-
const isCircular = (url) => urlStack.includes(url);
|
49896
49921
|
const { isProduction, resolve: { dedupe, preserveSymlinks }, root, ssr, } = server.config;
|
49897
49922
|
const overrideConditions = ssr.resolve?.externalConditions || [];
|
49898
49923
|
const resolveOptions = {
|
@@ -49909,9 +49934,6 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
|
|
49909
49934
|
legacyProxySsrExternalModules: server.config.legacy?.proxySsrExternalModules,
|
49910
49935
|
packageCache: server.config.packageCache,
|
49911
49936
|
};
|
49912
|
-
// Since dynamic imports can happen in parallel, we need to
|
49913
|
-
// account for multiple pending deps and duplicate imports.
|
49914
|
-
const pendingDeps = [];
|
49915
49937
|
const ssrImport = async (dep, metadata) => {
|
49916
49938
|
try {
|
49917
49939
|
if (dep[0] !== '.' && dep[0] !== '/') {
|
@@ -49919,22 +49941,25 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
|
|
49919
49941
|
}
|
49920
49942
|
// convert to rollup URL because `pendingImports`, `moduleGraph.urlToModuleMap` requires that
|
49921
49943
|
dep = unwrapId$1(dep);
|
49922
|
-
|
49923
|
-
|
49924
|
-
|
49925
|
-
|
49926
|
-
|
49927
|
-
|
49928
|
-
|
49929
|
-
|
49930
|
-
|
49931
|
-
|
49932
|
-
|
49944
|
+
// Handle any potential circular dependencies for static imports, preventing
|
49945
|
+
// deadlock scenarios when two modules are indirectly waiting on one another
|
49946
|
+
// to finish initializing. Dynamic imports are resolved at runtime, hence do
|
49947
|
+
// not contribute to the static module dependency graph in the same way
|
49948
|
+
if (!metadata?.isDynamicImport) {
|
49949
|
+
addPendingModuleDependency(url, dep);
|
49950
|
+
// If there's a circular dependency formed as a result of the dep import,
|
49951
|
+
// return the current state of the dependent module being initialized, in
|
49952
|
+
// order to avoid interlocking circular dependencies hanging indefinitely
|
49953
|
+
if (checkModuleDependencyExists(dep, url)) {
|
49954
|
+
const depSsrModule = moduleGraph.urlToModuleMap.get(dep)?.ssrModule;
|
49955
|
+
if (!depSsrModule) {
|
49956
|
+
// Technically, this should never happen under normal circumstances
|
49957
|
+
throw new Error('[vite] The dependency module is not yet fully initialized due to circular dependency. This is a bug in Vite SSR');
|
49958
|
+
}
|
49959
|
+
return depSsrModule;
|
49933
49960
|
}
|
49934
|
-
// return local module to avoid race condition #5470
|
49935
|
-
return mod;
|
49936
49961
|
}
|
49937
|
-
return
|
49962
|
+
return ssrLoadModule(dep, server, context, fixStacktrace);
|
49938
49963
|
}
|
49939
49964
|
catch (err) {
|
49940
49965
|
// tell external error handler which mod was imported with error
|
@@ -49994,8 +50019,41 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
|
|
49994
50019
|
});
|
49995
50020
|
throw e;
|
49996
50021
|
}
|
50022
|
+
finally {
|
50023
|
+
pendingModuleDependencyGraph.delete(url);
|
50024
|
+
}
|
49997
50025
|
return Object.freeze(ssrModule);
|
49998
50026
|
}
|
50027
|
+
function addPendingModuleDependency(originUrl, depUrl) {
|
50028
|
+
if (pendingModuleDependencyGraph.has(originUrl)) {
|
50029
|
+
pendingModuleDependencyGraph.get(originUrl).add(depUrl);
|
50030
|
+
}
|
50031
|
+
else {
|
50032
|
+
pendingModuleDependencyGraph.set(originUrl, new Set([depUrl]));
|
50033
|
+
}
|
50034
|
+
}
|
50035
|
+
function checkModuleDependencyExists(originUrl, targetUrl) {
|
50036
|
+
const visited = new Set();
|
50037
|
+
const stack = [originUrl];
|
50038
|
+
while (stack.length) {
|
50039
|
+
const currentUrl = stack.pop();
|
50040
|
+
if (currentUrl === targetUrl) {
|
50041
|
+
return true;
|
50042
|
+
}
|
50043
|
+
if (!visited.has(currentUrl)) {
|
50044
|
+
visited.add(currentUrl);
|
50045
|
+
const dependencies = pendingModuleDependencyGraph.get(currentUrl);
|
50046
|
+
if (dependencies) {
|
50047
|
+
for (const depUrl of dependencies) {
|
50048
|
+
if (!visited.has(depUrl)) {
|
50049
|
+
stack.push(depUrl);
|
50050
|
+
}
|
50051
|
+
}
|
50052
|
+
}
|
50053
|
+
}
|
50054
|
+
}
|
50055
|
+
return false;
|
50056
|
+
}
|
49999
50057
|
// In node@12+ we can use dynamic import to load CJS and ESM
|
50000
50058
|
async function nodeImport(id, importer, resolveOptions, metadata) {
|
50001
50059
|
let url;
|
@@ -59743,7 +59801,7 @@ async function _createServer(inlineConfig = {}, options) {
|
|
59743
59801
|
return devHtmlTransformFn(server, url, html, originalUrl);
|
59744
59802
|
},
|
59745
59803
|
async ssrLoadModule(url, opts) {
|
59746
|
-
return ssrLoadModule(url, server, undefined,
|
59804
|
+
return ssrLoadModule(url, server, undefined, opts?.fixStacktrace);
|
59747
59805
|
},
|
59748
59806
|
async ssrFetchModule(url, importer) {
|
59749
59807
|
return ssrFetchModule(server, url, importer);
|
@@ -61602,6 +61660,7 @@ const preloadMarker = `__VITE_PRELOAD__`;
|
|
61602
61660
|
const preloadHelperId = '\0vite/preload-helper.js';
|
61603
61661
|
const preloadMarkerRE = new RegExp(preloadMarker, 'g');
|
61604
61662
|
const dynamicImportPrefixRE = /import\s*\(/;
|
61663
|
+
const dynamicImportTreeshakenRE = /(\b(const|let|var)\s+(\{[^}.]+\})\s*=\s*await\s+import\([^)]+\))|(\(\s*await\s+import\([^)]+\)\s*\)(\??\.[^;[\s]+)+)|\bimport\([^)]+\)(\s*\.then\([^{]*?\(\s*\{([^}.]+)\})/g;
|
61605
61664
|
function toRelativePath(filename, importer) {
|
61606
61665
|
const relPath = path$o.posix.relative(path$o.posix.dirname(importer), filename);
|
61607
61666
|
return relPath[0] === '.' ? relPath : `./${relPath}`;
|
@@ -61753,6 +61812,55 @@ function buildImportAnalysisPlugin(config) {
|
|
61753
61812
|
if (!imports.length) {
|
61754
61813
|
return null;
|
61755
61814
|
}
|
61815
|
+
// when wrapping dynamic imports with a preload helper, Rollup is unable to analyze the
|
61816
|
+
// accessed variables for treeshaking. This below tries to match common accessed syntax
|
61817
|
+
// to "copy" it over to the dynamic import wrapped by the preload helper.
|
61818
|
+
const dynamicImports = {};
|
61819
|
+
if (insertPreload) {
|
61820
|
+
let match;
|
61821
|
+
while ((match = dynamicImportTreeshakenRE.exec(source))) {
|
61822
|
+
/* handle `const {foo} = await import('foo')`
|
61823
|
+
*
|
61824
|
+
* match[1]: `const {foo} = await import('foo')`
|
61825
|
+
* match[2]: `const`
|
61826
|
+
* match[3]: `{foo}`
|
61827
|
+
* import end: `const {foo} = await import('foo')_`
|
61828
|
+
* ^
|
61829
|
+
*/
|
61830
|
+
if (match[1]) {
|
61831
|
+
dynamicImports[dynamicImportTreeshakenRE.lastIndex] = {
|
61832
|
+
declaration: `${match[2]} ${match[3]}`,
|
61833
|
+
names: match[3]?.trim(),
|
61834
|
+
};
|
61835
|
+
continue;
|
61836
|
+
}
|
61837
|
+
/* handle `(await import('foo')).foo`
|
61838
|
+
*
|
61839
|
+
* match[4]: `(await import('foo')).foo`
|
61840
|
+
* match[5]: `.foo`
|
61841
|
+
* import end: `(await import('foo'))`
|
61842
|
+
* ^
|
61843
|
+
*/
|
61844
|
+
if (match[4]) {
|
61845
|
+
let names = match[5].match(/\.([^.?]+)/)?.[1] || '';
|
61846
|
+
// avoid `default` keyword error
|
61847
|
+
if (names === 'default') {
|
61848
|
+
names = 'default: __vite_default__';
|
61849
|
+
}
|
61850
|
+
dynamicImports[dynamicImportTreeshakenRE.lastIndex - match[5]?.length - 1] = { declaration: `const {${names}}`, names: `{ ${names} }` };
|
61851
|
+
continue;
|
61852
|
+
}
|
61853
|
+
/* handle `import('foo').then(({foo})=>{})`
|
61854
|
+
*
|
61855
|
+
* match[6]: `.then(({foo}`
|
61856
|
+
* match[7]: `foo`
|
61857
|
+
* import end: `import('foo').`
|
61858
|
+
* ^
|
61859
|
+
*/
|
61860
|
+
const names = match[7]?.trim();
|
61861
|
+
dynamicImports[dynamicImportTreeshakenRE.lastIndex - match[6]?.length] = { declaration: `const {${names}}`, names: `{ ${names} }` };
|
61862
|
+
}
|
61863
|
+
}
|
61756
61864
|
let s;
|
61757
61865
|
const str = () => s || (s = new MagicString(source));
|
61758
61866
|
let needPreloadHelper = false;
|
@@ -61770,7 +61878,23 @@ function buildImportAnalysisPlugin(config) {
|
|
61770
61878
|
source[start] === "'" ||
|
61771
61879
|
source[start] === '`')) {
|
61772
61880
|
needPreloadHelper = true;
|
61773
|
-
|
61881
|
+
const { declaration, names } = dynamicImports[expEnd] || {};
|
61882
|
+
if (names) {
|
61883
|
+
/* transform `const {foo} = await import('foo')`
|
61884
|
+
* to `const {foo} = await __vitePreload(async () => { const {foo} = await import('foo');return {foo}}, ...)`
|
61885
|
+
*
|
61886
|
+
* transform `import('foo').then(({foo})=>{})`
|
61887
|
+
* to `__vitePreload(async () => { const {foo} = await import('foo');return { foo }},...).then(({foo})=>{})`
|
61888
|
+
*
|
61889
|
+
* transform `(await import('foo')).foo`
|
61890
|
+
* to `__vitePreload(async () => { const {foo} = (await import('foo')).foo; return { foo }},...)).foo`
|
61891
|
+
*/
|
61892
|
+
str().prependLeft(expStart, `${preloadMethod}(async () => { ${declaration} = await `);
|
61893
|
+
str().appendRight(expEnd, `;return ${names}}`);
|
61894
|
+
}
|
61895
|
+
else {
|
61896
|
+
str().prependLeft(expStart, `${preloadMethod}(() => `);
|
61897
|
+
}
|
61774
61898
|
str().appendRight(expEnd, `,${isModernFlag}?${preloadMarker}:void 0${optimizeModulePreloadRelativePaths || customModulePreloadPaths
|
61775
61899
|
? ',import.meta.url'
|
61776
61900
|
: ''})`);
|
@@ -61813,7 +61937,54 @@ function buildImportAnalysisPlugin(config) {
|
|
61813
61937
|
return null;
|
61814
61938
|
},
|
61815
61939
|
generateBundle({ format }, bundle) {
|
61816
|
-
if (format !== 'es'
|
61940
|
+
if (format !== 'es') {
|
61941
|
+
return;
|
61942
|
+
}
|
61943
|
+
if (ssr || isWorker) {
|
61944
|
+
const removedPureCssFiles = removedPureCssFilesCache.get(config);
|
61945
|
+
if (removedPureCssFiles && removedPureCssFiles.size > 0) {
|
61946
|
+
for (const file in bundle) {
|
61947
|
+
const chunk = bundle[file];
|
61948
|
+
if (chunk.type === 'chunk' && chunk.code.includes('import')) {
|
61949
|
+
const code = chunk.code;
|
61950
|
+
let imports;
|
61951
|
+
try {
|
61952
|
+
imports = parse$f(code)[0].filter((i) => i.d > -1);
|
61953
|
+
}
|
61954
|
+
catch (e) {
|
61955
|
+
const loc = numberToPos(code, e.idx);
|
61956
|
+
this.error({
|
61957
|
+
name: e.name,
|
61958
|
+
message: e.message,
|
61959
|
+
stack: e.stack,
|
61960
|
+
cause: e.cause,
|
61961
|
+
pos: e.idx,
|
61962
|
+
loc: { ...loc, file: chunk.fileName },
|
61963
|
+
frame: generateCodeFrame(code, loc),
|
61964
|
+
});
|
61965
|
+
}
|
61966
|
+
for (const imp of imports) {
|
61967
|
+
const { n: name, s: start, e: end, ss: expStart, se: expEnd, } = imp;
|
61968
|
+
let url = name;
|
61969
|
+
if (!url) {
|
61970
|
+
const rawUrl = code.slice(start, end);
|
61971
|
+
if (rawUrl[0] === `"` && rawUrl[rawUrl.length - 1] === `"`)
|
61972
|
+
url = rawUrl.slice(1, -1);
|
61973
|
+
}
|
61974
|
+
if (!url)
|
61975
|
+
continue;
|
61976
|
+
const normalizedFile = path$o.posix.join(path$o.posix.dirname(chunk.fileName), url);
|
61977
|
+
if (removedPureCssFiles.has(normalizedFile)) {
|
61978
|
+
// remove with Promise.resolve({}) while preserving source map location
|
61979
|
+
chunk.code =
|
61980
|
+
chunk.code.slice(0, expStart) +
|
61981
|
+
`Promise.resolve({${''.padEnd(expEnd - expStart - 19, ' ')}})` +
|
61982
|
+
chunk.code.slice(expEnd);
|
61983
|
+
}
|
61984
|
+
}
|
61985
|
+
}
|
61986
|
+
}
|
61987
|
+
}
|
61817
61988
|
return;
|
61818
61989
|
}
|
61819
61990
|
for (const file in bundle) {
|
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 colors, v as createLogger, r as resolveConfig } from './chunks/dep-
|
5
|
+
import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-Dz0We6of.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
@@ -757,7 +757,7 @@ cli
|
|
757
757
|
filterDuplicateOptions(options);
|
758
758
|
// output structure is preserved even after bundling so require()
|
759
759
|
// is ok here
|
760
|
-
const { createServer } = await import('./chunks/dep-
|
760
|
+
const { createServer } = await import('./chunks/dep-Dz0We6of.js').then(function (n) { return n.E; });
|
761
761
|
try {
|
762
762
|
const server = await createServer({
|
763
763
|
root,
|
@@ -836,7 +836,7 @@ cli
|
|
836
836
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
837
837
|
.action(async (root, options) => {
|
838
838
|
filterDuplicateOptions(options);
|
839
|
-
const { build } = await import('./chunks/dep-
|
839
|
+
const { build } = await import('./chunks/dep-Dz0We6of.js').then(function (n) { return n.F; });
|
840
840
|
const buildOptions = cleanOptions(options);
|
841
841
|
try {
|
842
842
|
await build({
|
@@ -863,7 +863,7 @@ cli
|
|
863
863
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
864
864
|
.action(async (root, options) => {
|
865
865
|
filterDuplicateOptions(options);
|
866
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
866
|
+
const { optimizeDeps } = await import('./chunks/dep-Dz0We6of.js').then(function (n) { return n.D; });
|
867
867
|
try {
|
868
868
|
const config = await resolveConfig({
|
869
869
|
root,
|
@@ -889,7 +889,7 @@ cli
|
|
889
889
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
890
890
|
.action(async (root, options) => {
|
891
891
|
filterDuplicateOptions(options);
|
892
|
-
const { preview } = await import('./chunks/dep-
|
892
|
+
const { preview } = await import('./chunks/dep-Dz0We6of.js').then(function (n) { return n.G; });
|
893
893
|
try {
|
894
894
|
const server = await preview({
|
895
895
|
root,
|
package/dist/node/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
2
|
-
import { i as isInNodeModules, a as arraify } from './chunks/dep-
|
3
|
-
export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
2
|
+
import { i as isInNodeModules, a as arraify } from './chunks/dep-Dz0We6of.js';
|
3
|
+
export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-Dz0We6of.js';
|
4
4
|
export { VERSION as version } from './constants.js';
|
5
5
|
export { version as esbuildVersion } from 'esbuild';
|
6
6
|
import { existsSync, readFileSync } from 'node:fs';
|
@@ -1127,11 +1127,11 @@ function requireNode () {
|
|
1127
1127
|
}
|
1128
1128
|
|
1129
1129
|
/**
|
1130
|
-
* Invokes `util.
|
1130
|
+
* Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
|
1131
1131
|
*/
|
1132
1132
|
|
1133
1133
|
function log(...args) {
|
1134
|
-
return process.stderr.write(util.
|
1134
|
+
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
|
1135
1135
|
}
|
1136
1136
|
|
1137
1137
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "5.3.0-beta.
|
3
|
+
"version": "5.3.0-beta.1",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -100,7 +100,7 @@
|
|
100
100
|
"convert-source-map": "^2.0.0",
|
101
101
|
"cors": "^2.8.5",
|
102
102
|
"cross-spawn": "^7.0.3",
|
103
|
-
"debug": "^4.3.
|
103
|
+
"debug": "^4.3.5",
|
104
104
|
"dep-types": "link:./src/types",
|
105
105
|
"dotenv": "^16.4.5",
|
106
106
|
"dotenv-expand": "^11.0.6",
|
@@ -129,12 +129,12 @@
|
|
129
129
|
"rollup-plugin-dts": "^6.1.1",
|
130
130
|
"rollup-plugin-esbuild": "^6.1.1",
|
131
131
|
"rollup-plugin-license": "^3.4.0",
|
132
|
-
"sass": "^1.77.
|
132
|
+
"sass": "^1.77.4",
|
133
133
|
"sirv": "^2.0.4",
|
134
134
|
"source-map-support": "^0.5.21",
|
135
135
|
"strip-ansi": "^7.1.0",
|
136
136
|
"strip-literal": "^2.1.0",
|
137
|
-
"tsconfck": "^3.0
|
137
|
+
"tsconfck": "^3.1.0",
|
138
138
|
"tslib": "^2.6.2",
|
139
139
|
"types": "link:./types",
|
140
140
|
"ufo": "^1.5.3",
|