vite 4.4.0 → 4.4.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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-
|
|
1
|
+
import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-439026c8.js';
|
|
2
2
|
import require$$0__default from 'fs';
|
|
3
3
|
import require$$0 from 'postcss';
|
|
4
4
|
import require$$0$1 from 'path';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs$l from 'node:fs';
|
|
2
2
|
import fsp from 'node:fs/promises';
|
|
3
|
-
import path$o, { dirname as dirname$2, join as join$2,
|
|
3
|
+
import path$o, { dirname as dirname$2, join as join$2, posix as posix$1, isAbsolute as isAbsolute$2, relative as relative$2, basename as basename$2, extname as extname$1 } from 'node:path';
|
|
4
4
|
import { fileURLToPath, URL as URL$3, URLSearchParams, parse as parse$i, pathToFileURL } from 'node:url';
|
|
5
5
|
import { promisify as promisify$4, format as format$2, inspect } from 'node:util';
|
|
6
6
|
import { performance } from 'node:perf_hooks';
|
|
@@ -38874,8 +38874,8 @@ function createCachedImport(imp) {
|
|
|
38874
38874
|
return cached;
|
|
38875
38875
|
};
|
|
38876
38876
|
}
|
|
38877
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
|
38878
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
|
38877
|
+
const importPostcssImport = createCachedImport(() => import('./dep-b3c79893.js').then(function (n) { return n.i; }));
|
|
38878
|
+
const importPostcssModules = createCachedImport(() => import('./dep-198ec93b.js').then(function (n) { return n.i; }));
|
|
38879
38879
|
const importPostcss = createCachedImport(() => import('postcss'));
|
|
38880
38880
|
/**
|
|
38881
38881
|
* @experimental
|
|
@@ -40903,7 +40903,7 @@ const createCssDefaultImportWarning = (globs, options) => `if (!${warnedCSSDefau
|
|
|
40903
40903
|
async function transformGlobImport(code, id, root, resolveId, isProduction, restoreQueryExtension = false) {
|
|
40904
40904
|
id = slash$1(id);
|
|
40905
40905
|
root = slash$1(root);
|
|
40906
|
-
const isVirtual =
|
|
40906
|
+
const isVirtual = isVirtualModule(id);
|
|
40907
40907
|
const dir = isVirtual ? undefined : dirname(id);
|
|
40908
40908
|
const matches = await parseImportGlob(code, isVirtual ? undefined : id, root, resolveId);
|
|
40909
40909
|
const matchedFiles = new Set();
|
|
@@ -41108,6 +41108,10 @@ function getCommonBase(globsResolved) {
|
|
|
41108
41108
|
commonAncestor = '/';
|
|
41109
41109
|
return commonAncestor;
|
|
41110
41110
|
}
|
|
41111
|
+
function isVirtualModule(id) {
|
|
41112
|
+
// https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention
|
|
41113
|
+
return id.startsWith('virtual:') || id[0] === '\0' || !id.includes('/');
|
|
41114
|
+
}
|
|
41111
41115
|
|
|
41112
41116
|
const debugHmr = createDebugger('vite:hmr');
|
|
41113
41117
|
const whitespaceRE = /\s/;
|
|
@@ -41983,8 +41987,7 @@ function importAnalysisPlugin(config) {
|
|
|
41983
41987
|
// normalize and rewrite accepted urls
|
|
41984
41988
|
const normalizedAcceptedUrls = new Set();
|
|
41985
41989
|
for (const { url, start, end } of acceptedUrls) {
|
|
41986
|
-
const
|
|
41987
|
-
const [normalized] = await moduleGraph.resolveUrl(isRelative ? toAbsoluteUrl(url) : url, ssr);
|
|
41990
|
+
const [normalized] = await moduleGraph.resolveUrl(toAbsoluteUrl(url), ssr);
|
|
41988
41991
|
normalizedAcceptedUrls.add(normalized);
|
|
41989
41992
|
str().overwrite(start, end, JSON.stringify(normalized), {
|
|
41990
41993
|
contentOnly: true,
|
|
@@ -66068,18 +66071,19 @@ const _require = createRequire$1(import.meta.url);
|
|
|
66068
66071
|
async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {
|
|
66069
66072
|
// for esm, before we can register loaders without requiring users to run node
|
|
66070
66073
|
// with --experimental-loader themselves, we have to do a hack here:
|
|
66071
|
-
//
|
|
66074
|
+
// write it to disk, load it with native Node ESM, then delete the file.
|
|
66072
66075
|
if (isESM) {
|
|
66076
|
+
const fileBase = `${fileName}.timestamp-${Date.now()}-${Math.random()
|
|
66077
|
+
.toString(16)
|
|
66078
|
+
.slice(2)}`;
|
|
66079
|
+
const fileNameTmp = `${fileBase}.mjs`;
|
|
66080
|
+
const fileUrl = `${pathToFileURL(fileBase)}.mjs`;
|
|
66081
|
+
await fsp.writeFile(fileNameTmp, bundledCode);
|
|
66073
66082
|
try {
|
|
66074
|
-
|
|
66075
|
-
const configTimestamp = `${fileName}.timestamp:${Date.now()}-${Math.random()
|
|
66076
|
-
.toString(16)
|
|
66077
|
-
.slice(2)}`;
|
|
66078
|
-
return (await dynamicImport('data:text/javascript;base64,' +
|
|
66079
|
-
Buffer.from(`${bundledCode}\n//${configTimestamp}`).toString('base64'))).default;
|
|
66083
|
+
return (await dynamicImport(fileUrl)).default;
|
|
66080
66084
|
}
|
|
66081
|
-
|
|
66082
|
-
|
|
66085
|
+
finally {
|
|
66086
|
+
fs$l.unlink(fileNameTmp, () => { }); // Ignore errors
|
|
66083
66087
|
}
|
|
66084
66088
|
}
|
|
66085
66089
|
// for cjs, we can register a custom loader via `_require.extensions`
|
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, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-439026c8.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:url';
|
|
@@ -738,7 +738,7 @@ cli
|
|
|
738
738
|
filterDuplicateOptions(options);
|
|
739
739
|
// output structure is preserved even after bundling so require()
|
|
740
740
|
// is ok here
|
|
741
|
-
const { createServer } = await import('./chunks/dep-
|
|
741
|
+
const { createServer } = await import('./chunks/dep-439026c8.js').then(function (n) { return n.I; });
|
|
742
742
|
try {
|
|
743
743
|
const server = await createServer({
|
|
744
744
|
root,
|
|
@@ -816,7 +816,7 @@ cli
|
|
|
816
816
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
817
817
|
.action(async (root, options) => {
|
|
818
818
|
filterDuplicateOptions(options);
|
|
819
|
-
const { build } = await import('./chunks/dep-
|
|
819
|
+
const { build } = await import('./chunks/dep-439026c8.js').then(function (n) { return n.H; });
|
|
820
820
|
const buildOptions = cleanOptions(options);
|
|
821
821
|
try {
|
|
822
822
|
await build({
|
|
@@ -844,7 +844,7 @@ cli
|
|
|
844
844
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
845
845
|
.action(async (root, options) => {
|
|
846
846
|
filterDuplicateOptions(options);
|
|
847
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
847
|
+
const { optimizeDeps } = await import('./chunks/dep-439026c8.js').then(function (n) { return n.G; });
|
|
848
848
|
try {
|
|
849
849
|
const config = await resolveConfig({
|
|
850
850
|
root,
|
|
@@ -871,7 +871,7 @@ cli
|
|
|
871
871
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
872
872
|
.action(async (root, options) => {
|
|
873
873
|
filterDuplicateOptions(options);
|
|
874
|
-
const { preview } = await import('./chunks/dep-
|
|
874
|
+
const { preview } = await import('./chunks/dep-439026c8.js').then(function (n) { return n.J; });
|
|
875
875
|
try {
|
|
876
876
|
const server = await preview({
|
|
877
877
|
root,
|
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-439026c8.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-439026c8.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';
|