vite 5.4.16 → 5.4.18
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.
@@ -36991,8 +36991,8 @@ function createCachedImport(imp) {
|
|
36991
36991
|
return cached;
|
36992
36992
|
};
|
36993
36993
|
}
|
36994
|
-
const importPostcssImport = createCachedImport(() => import('./dep-
|
36995
|
-
const importPostcssModules = createCachedImport(() => import('./dep-
|
36994
|
+
const importPostcssImport = createCachedImport(() => import('./dep-75Pw0qnz.js').then(function (n) { return n.i; }));
|
36995
|
+
const importPostcssModules = createCachedImport(() => import('./dep-nOVVHa2_.js').then(function (n) { return n.i; }));
|
36996
36996
|
const importPostcss = createCachedImport(() => import('postcss'));
|
36997
36997
|
const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
|
36998
36998
|
let alwaysFakeWorkerWorkerControllerCache;
|
@@ -47527,6 +47527,7 @@ function escapeReplacement(value) {
|
|
47527
47527
|
}
|
47528
47528
|
|
47529
47529
|
const wasmHelperId = "\0vite/wasm-helper.js";
|
47530
|
+
const wasmInitRE = /(?<![?#].*)\.wasm\?init/;
|
47530
47531
|
const wasmHelper = async (opts = {}, url) => {
|
47531
47532
|
let result;
|
47532
47533
|
if (url.startsWith("data:")) {
|
@@ -47571,7 +47572,7 @@ const wasmHelperPlugin = (config) => {
|
|
47571
47572
|
if (id === wasmHelperId) {
|
47572
47573
|
return `export default ${wasmHelperCode}`;
|
47573
47574
|
}
|
47574
|
-
if (!
|
47575
|
+
if (!wasmInitRE.test(id)) {
|
47575
47576
|
return;
|
47576
47577
|
}
|
47577
47578
|
const url = await fileToUrl$1(id, config, this);
|
@@ -51764,6 +51765,7 @@ function renderRestrictedErrorHTML(msg) {
|
|
51764
51765
|
|
51765
51766
|
const ERR_LOAD_URL = "ERR_LOAD_URL";
|
51766
51767
|
const ERR_LOAD_PUBLIC_URL = "ERR_LOAD_PUBLIC_URL";
|
51768
|
+
const ERR_DENIED_ID = "ERR_DENIED_ID";
|
51767
51769
|
const debugLoad = createDebugger("vite:load");
|
51768
51770
|
const debugTransform = createDebugger("vite:transform");
|
51769
51771
|
const debugCache$1 = createDebugger("vite:cache");
|
@@ -51865,6 +51867,11 @@ async function loadAndTransform(id, url, server, options, timestamp, mod, resolv
|
|
51865
51867
|
const prettyUrl = debugLoad || debugTransform ? prettifyUrl(url, config.root) : "";
|
51866
51868
|
const ssr = !!options.ssr;
|
51867
51869
|
const file = cleanUrl(id);
|
51870
|
+
if (options.allowId && !options.allowId(id)) {
|
51871
|
+
const err = new Error(`Denied ID ${id}`);
|
51872
|
+
err.code = ERR_DENIED_ID;
|
51873
|
+
throw err;
|
51874
|
+
}
|
51868
51875
|
let code = null;
|
51869
51876
|
let map = null;
|
51870
51877
|
const loadStart = debugLoad ? performance$1.now() : 0;
|
@@ -61932,6 +61939,10 @@ const trailingQuerySeparatorsRE = /[?&]+$/;
|
|
61932
61939
|
const urlRE = /[?&]url\b/;
|
61933
61940
|
const rawRE = /[?&]raw\b/;
|
61934
61941
|
const inlineRE = /[?&]inline\b/;
|
61942
|
+
const svgRE = /\.svg\b/;
|
61943
|
+
function deniedServingAccessForTransform(url, server, res, next) {
|
61944
|
+
return (rawRE.test(url) || urlRE.test(url) || inlineRE.test(url) || svgRE.test(url)) && !ensureServingAccess(url, server, res, next);
|
61945
|
+
}
|
61935
61946
|
function cachedTransformMiddleware(server) {
|
61936
61947
|
return function viteCachedTransformMiddleware(req, res, next) {
|
61937
61948
|
const ifNoneMatch = req.headers["if-none-match"];
|
@@ -62019,7 +62030,7 @@ function transformMiddleware(server) {
|
|
62019
62030
|
trailingQuerySeparatorsRE,
|
62020
62031
|
""
|
62021
62032
|
);
|
62022
|
-
if ((
|
62033
|
+
if (deniedServingAccessForTransform(
|
62023
62034
|
urlWithoutTrailingQuerySeparators,
|
62024
62035
|
server,
|
62025
62036
|
res,
|
@@ -62042,7 +62053,10 @@ function transformMiddleware(server) {
|
|
62042
62053
|
}
|
62043
62054
|
}
|
62044
62055
|
const result = await transformRequest(url, server, {
|
62045
|
-
html: req.headers.accept?.includes("text/html")
|
62056
|
+
html: req.headers.accept?.includes("text/html"),
|
62057
|
+
allowId(id) {
|
62058
|
+
return !deniedServingAccessForTransform(id, server, res, next);
|
62059
|
+
}
|
62046
62060
|
});
|
62047
62061
|
if (result) {
|
62048
62062
|
const depsOptimizer = getDepsOptimizer(server.config, false);
|
@@ -62094,6 +62108,9 @@ function transformMiddleware(server) {
|
|
62094
62108
|
if (e?.code === ERR_LOAD_URL) {
|
62095
62109
|
return next();
|
62096
62110
|
}
|
62111
|
+
if (e?.code === ERR_DENIED_ID) {
|
62112
|
+
return;
|
62113
|
+
}
|
62097
62114
|
return next(e);
|
62098
62115
|
}
|
62099
62116
|
next();
|
@@ -62914,6 +62931,17 @@ function mapFiles(files, root) {
|
|
62914
62931
|
});
|
62915
62932
|
}
|
62916
62933
|
|
62934
|
+
function rejectInvalidRequestMiddleware() {
|
62935
|
+
return function viteRejectInvalidRequestMiddleware(req, res, next) {
|
62936
|
+
if (req.url?.includes("#")) {
|
62937
|
+
res.writeHead(400);
|
62938
|
+
res.end();
|
62939
|
+
return;
|
62940
|
+
}
|
62941
|
+
return next();
|
62942
|
+
};
|
62943
|
+
}
|
62944
|
+
|
62917
62945
|
function createServer(inlineConfig = {}) {
|
62918
62946
|
return _createServer(inlineConfig, { hotListen: true });
|
62919
62947
|
}
|
@@ -63245,6 +63273,7 @@ async function _createServer(inlineConfig = {}, options) {
|
|
63245
63273
|
if (process.env.DEBUG) {
|
63246
63274
|
middlewares.use(timeMiddleware(root));
|
63247
63275
|
}
|
63276
|
+
middlewares.use(rejectInvalidRequestMiddleware());
|
63248
63277
|
const { cors } = serverConfig;
|
63249
63278
|
if (cors !== false) {
|
63250
63279
|
middlewares.use(
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-
|
1
|
+
import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-DbT5NFX0.js';
|
2
2
|
import require$$0__default from 'fs';
|
3
3
|
import require$$0 from 'postcss';
|
4
4
|
import require$$0$1 from 'path';
|
package/dist/node/cli.js
CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
2
2
|
import fs__default 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-DbT5NFX0.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
@@ -731,7 +731,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
731
731
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
732
732
|
).action(async (root, options) => {
|
733
733
|
filterDuplicateOptions(options);
|
734
|
-
const { createServer } = await import('./chunks/dep-
|
734
|
+
const { createServer } = await import('./chunks/dep-DbT5NFX0.js').then(function (n) { return n.E; });
|
735
735
|
try {
|
736
736
|
const server = await createServer({
|
737
737
|
root,
|
@@ -823,7 +823,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
823
823
|
`[boolean] force empty outDir when it's outside of root`
|
824
824
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).action(async (root, options) => {
|
825
825
|
filterDuplicateOptions(options);
|
826
|
-
const { build } = await import('./chunks/dep-
|
826
|
+
const { build } = await import('./chunks/dep-DbT5NFX0.js').then(function (n) { return n.F; });
|
827
827
|
const buildOptions = cleanOptions(options);
|
828
828
|
try {
|
829
829
|
await build({
|
@@ -852,7 +852,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
|
|
852
852
|
).action(
|
853
853
|
async (root, options) => {
|
854
854
|
filterDuplicateOptions(options);
|
855
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
855
|
+
const { optimizeDeps } = await import('./chunks/dep-DbT5NFX0.js').then(function (n) { return n.D; });
|
856
856
|
try {
|
857
857
|
const config = await resolveConfig(
|
858
858
|
{
|
@@ -878,7 +878,7 @@ ${e.stack}`),
|
|
878
878
|
cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(
|
879
879
|
async (root, options) => {
|
880
880
|
filterDuplicateOptions(options);
|
881
|
-
const { preview } = await import('./chunks/dep-
|
881
|
+
const { preview } = await import('./chunks/dep-DbT5NFX0.js').then(function (n) { return n.G; });
|
882
882
|
try {
|
883
883
|
const server = await preview({
|
884
884
|
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-DbT5NFX0.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-DbT5NFX0.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';
|