vite
Advanced tools
Comparing version 5.1.5 to 5.1.6
@@ -5,3 +5,3 @@ import path from 'node:path'; | ||
import { EventEmitter } from 'events'; | ||
import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-G-px366b.js'; | ||
import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-jvB8WLp9.js'; | ||
import { VERSION } from './constants.js'; | ||
@@ -761,3 +761,3 @@ import 'node:fs/promises'; | ||
// is ok here | ||
const { createServer } = await import('./chunks/dep-G-px366b.js').then(function (n) { return n.E; }); | ||
const { createServer } = await import('./chunks/dep-jvB8WLp9.js').then(function (n) { return n.E; }); | ||
try { | ||
@@ -841,3 +841,3 @@ const server = await createServer({ | ||
filterDuplicateOptions(options); | ||
const { build } = await import('./chunks/dep-G-px366b.js').then(function (n) { return n.F; }); | ||
const { build } = await import('./chunks/dep-jvB8WLp9.js').then(function (n) { return n.F; }); | ||
const buildOptions = cleanOptions(options); | ||
@@ -869,3 +869,3 @@ try { | ||
filterDuplicateOptions(options); | ||
const { optimizeDeps } = await import('./chunks/dep-G-px366b.js').then(function (n) { return n.D; }); | ||
const { optimizeDeps } = await import('./chunks/dep-jvB8WLp9.js').then(function (n) { return n.D; }); | ||
try { | ||
@@ -896,3 +896,3 @@ const config = await resolveConfig({ | ||
filterDuplicateOptions(options); | ||
const { preview } = await import('./chunks/dep-G-px366b.js').then(function (n) { return n.G; }); | ||
const { preview } = await import('./chunks/dep-jvB8WLp9.js').then(function (n) { return n.G; }); | ||
try { | ||
@@ -899,0 +899,0 @@ const server = await preview({ |
export { parseAst, parseAstAsync } from 'rollup/parseAst'; | ||
import { i as isInNodeModules, a as arraify } from './chunks/dep-G-px366b.js'; | ||
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-G-px366b.js'; | ||
import { i as isInNodeModules, a as arraify } from './chunks/dep-jvB8WLp9.js'; | ||
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-jvB8WLp9.js'; | ||
export { VERSION as version } from './constants.js'; | ||
@@ -5,0 +5,0 @@ export { version as esbuildVersion } from 'esbuild'; |
@@ -1,3 +0,3 @@ | ||
import { V as ViteRuntimeOptions, b as ViteModuleRunner, M as ModuleCacheMap, c as HMRClient, R as ResolvedResult, d as ViteRuntimeModuleContext } from './types.d-AKzkD8vd.js'; | ||
export { a as FetchFunction, F as FetchResult, e as HMRConnection, H as HMRLogger, g as HMRRuntimeConnection, f as ModuleCache, S as SSRImportMetadata, h as ViteRuntimeImportMeta, s as ssrDynamicImportKey, i as ssrExportAllKey, j as ssrImportKey, k as ssrImportMetaKey, l as ssrModuleExportsKey } from './types.d-AKzkD8vd.js'; | ||
import { V as ViteRuntimeOptions, b as ViteModuleRunner, M as ModuleCacheMap, c as HMRClient, R as ResolvedResult, d as ViteRuntimeModuleContext } from './types.d-FdqQ54oU.js'; | ||
export { a as FetchFunction, F as FetchResult, e as HMRConnection, H as HMRLogger, g as HMRRuntimeConnection, f as ModuleCache, S as SSRImportMetadata, h as ViteRuntimeImportMeta, s as ssrDynamicImportKey, i as ssrExportAllKey, j as ssrImportKey, k as ssrImportMetaKey, l as ssrModuleExportsKey } from './types.d-FdqQ54oU.js'; | ||
import '../../types/hot.js'; | ||
@@ -4,0 +4,0 @@ import '../../types/hmrPayload.js'; |
const VALID_ID_PREFIX = "/@id/", NULL_BYTE_PLACEHOLDER = "__x00__"; | ||
let SOURCEMAPPING_URL = "sourceMa"; | ||
SOURCEMAPPING_URL += "ppingURL"; | ||
const VITE_RUNTIME_SOURCEMAPPING_URL = `${SOURCEMAPPING_URL}=data:application/json;charset=utf-8`, isWindows = typeof process < "u" && process.platform === "win32"; | ||
const isWindows = typeof process < "u" && process.platform === "win32"; | ||
function wrapId(id) { | ||
@@ -11,2 +11,6 @@ return id.startsWith(VALID_ID_PREFIX) ? id : VALID_ID_PREFIX + id.replace("\0", NULL_BYTE_PLACEHOLDER); | ||
} | ||
const windowsSlashRE = /\\/g; | ||
function slash(p) { | ||
return p.replace(windowsSlashRE, "/"); | ||
} | ||
const postfixRE = /[?#].*$/; | ||
@@ -22,3 +26,4 @@ function cleanUrl(url) { | ||
} | ||
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//; | ||
const AsyncFunction = async function() { | ||
}.constructor, _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//; | ||
function normalizeWindowsPath(input = "") { | ||
@@ -220,3 +225,3 @@ return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase()); | ||
} | ||
const VITE_RUNTIME_SOURCEMAPPING_REGEXP = new RegExp(`//# ${VITE_RUNTIME_SOURCEMAPPING_URL};base64,(.+)`); | ||
const VITE_RUNTIME_SOURCEMAPPING_REGEXP = new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`); | ||
class ModuleCacheMap extends Map { | ||
@@ -327,3 +332,3 @@ root; | ||
return file; | ||
let unixFile = file.replace(/\\/g, "/").replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/"); | ||
let unixFile = slash(file).replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/"); | ||
return unixFile.startsWith(root) && (unixFile = unixFile.slice(root.length - 1)), unixFile.replace(/^file:\//, "/"); | ||
@@ -500,2 +505,25 @@ } | ||
} | ||
function analyzeImportedModDifference(mod, rawId, moduleType, metadata) { | ||
if (!metadata?.isDynamicImport && moduleType !== "module" && metadata?.importedNames?.length) { | ||
const missingBindings = metadata.importedNames.filter((s) => !(s in mod)); | ||
if (missingBindings.length) { | ||
const lastBinding = missingBindings[missingBindings.length - 1]; | ||
throw new SyntaxError(`[vite] Named export '${lastBinding}' not found. The requested module '${rawId}' is a CommonJS module, which may not support all module.exports as named exports. | ||
CommonJS modules can always be imported via the default export, for example using: | ||
import pkg from '${rawId}'; | ||
const {${missingBindings.join(", ")}} = pkg; | ||
`); | ||
} | ||
} | ||
} | ||
function proxyGuardOnlyEsm(mod, rawId, metadata) { | ||
return metadata?.importedNames?.length ? new Proxy(mod, { | ||
get(mod2, prop) { | ||
if (prop !== "then" && !(prop in mod2)) | ||
throw new SyntaxError(`[vite] The requested module '${rawId}' does not provide an export named '${prop.toString()}'`); | ||
return mod2[prop]; | ||
} | ||
}) : mod; | ||
} | ||
const ssrModuleExportsKey = "__vite_ssr_exports__", ssrImportKey = "__vite_ssr_import__", ssrDynamicImportKey = "__vite_ssr_dynamic_import__", ssrExportAllKey = "__vite_ssr_exportAll__", ssrImportMetaKey = "__vite_ssr_import_meta__", noop = () => { | ||
@@ -583,10 +611,10 @@ }, silentConsole = { | ||
return null; | ||
}, retrieveFileFromHandlers = createExecHandlers(retrieveFileHandlers), retrievSourceMapFromHandlers = createExecHandlers(retrieveSourceMapHandlers); | ||
let overriden = !1; | ||
}, retrieveFileFromHandlers = createExecHandlers(retrieveFileHandlers), retrieveSourceMapFromHandlers = createExecHandlers(retrieveSourceMapHandlers); | ||
let overridden = !1; | ||
const originalPrepare = Error.prepareStackTrace; | ||
function resetInterceptor(runtime, options) { | ||
moduleGraphs.delete(runtime.moduleCache), options.retrieveFile && retrieveFileHandlers.delete(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.delete(options.retrieveSourceMap), moduleGraphs.size === 0 && (Error.prepareStackTrace = originalPrepare, overriden = !1); | ||
moduleGraphs.delete(runtime.moduleCache), options.retrieveFile && retrieveFileHandlers.delete(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.delete(options.retrieveSourceMap), moduleGraphs.size === 0 && (Error.prepareStackTrace = originalPrepare, overridden = !1); | ||
} | ||
function interceptStackTrace(runtime, options = {}) { | ||
return overriden || (Error.prepareStackTrace = prepareStackTrace, overriden = !0), moduleGraphs.add(runtime.moduleCache), options.retrieveFile && retrieveFileHandlers.add(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.add(options.retrieveSourceMap), () => resetInterceptor(runtime, options); | ||
return overridden || (Error.prepareStackTrace = prepareStackTrace, overridden = !0), moduleGraphs.add(runtime.moduleCache), options.retrieveFile && retrieveFileHandlers.add(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.add(options.retrieveSourceMap), () => resetInterceptor(runtime, options); | ||
} | ||
@@ -596,6 +624,6 @@ function supportRelativeURL(file, url) { | ||
return url; | ||
const dir = posixDirname(file.replace(/\\/g, "/")), match = /^\w+:\/\/[^/]*/.exec(dir); | ||
const dir = posixDirname(slash(file)), match = /^\w+:\/\/[^/]*/.exec(dir); | ||
let protocol = match ? match[0] : ""; | ||
const startPath = dir.slice(protocol.length); | ||
return protocol && /^\/\w:/.test(startPath) ? (protocol += "/", protocol + posixResolve(dir.slice(protocol.length), url).replace(/\\/g, "/")) : protocol + posixResolve(dir.slice(protocol.length), url); | ||
return protocol && /^\/\w:/.test(startPath) ? (protocol += "/", protocol + slash(posixResolve(startPath, url))) : protocol + posixResolve(startPath, url); | ||
} | ||
@@ -632,3 +660,3 @@ function getRuntimeSourceMap(position) { | ||
function retrieveSourceMap(source) { | ||
const urlAndMap = retrievSourceMapFromHandlers(source); | ||
const urlAndMap = retrieveSourceMapFromHandlers(source); | ||
if (urlAndMap) | ||
@@ -858,3 +886,3 @@ return urlAndMap; | ||
return url; | ||
url.startsWith("file://") && (url = url.slice(isWindows ? 8 : 7)), url = url.replace(/\\/g, "/"); | ||
url.startsWith("file://") && (url = url.slice(isWindows ? 8 : 7)), url = slash(url); | ||
const _root = this.options.root, root = _root[_root.length - 1] === "/" ? _root : `${_root}/`; | ||
@@ -980,27 +1008,2 @@ return url.startsWith(root) ? url.slice(root.length - 1) : url[0] === "/" ? url : wrapId(url); | ||
} | ||
function analyzeImportedModDifference(mod, rawId, moduleType, metadata) { | ||
if (!metadata?.isDynamicImport && moduleType !== "module" && metadata?.importedNames?.length) { | ||
const missingBindings = metadata.importedNames.filter((s) => !(s in mod)); | ||
if (missingBindings.length) { | ||
const lastBinding = missingBindings[missingBindings.length - 1]; | ||
throw new SyntaxError(`[vite] Named export '${lastBinding}' not found. The requested module '${rawId}' is a CommonJS module, which may not support all module.exports as named exports. | ||
CommonJS modules can always be imported via the default export, for example using: | ||
import pkg from '${rawId}'; | ||
const {${missingBindings.join(", ")}} = pkg; | ||
`); | ||
} | ||
} | ||
} | ||
function proxyGuardOnlyEsm(mod, rawId, metadata) { | ||
return metadata?.importedNames?.length ? new Proxy(mod, { | ||
get(mod2, prop) { | ||
if (prop !== "then" && !(prop in mod2)) | ||
throw new SyntaxError(`[vite] The requested module '${rawId}' does not provide an export named '${prop.toString()}'`); | ||
return mod2[prop]; | ||
} | ||
}) : mod; | ||
} | ||
const AsyncFunction = async function() { | ||
}.constructor; | ||
class ESModulesRunner { | ||
@@ -1007,0 +1010,0 @@ async runViteModule(context, code) { |
{ | ||
"name": "vite", | ||
"version": "5.1.5", | ||
"version": "5.1.6", | ||
"type": "module", | ||
@@ -83,5 +83,5 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@ampproject/remapping": "^2.2.1", | ||
"@babel/parser": "^7.23.9", | ||
"@jridgewell/trace-mapping": "^0.3.23", | ||
"@ampproject/remapping": "^2.3.0", | ||
"@babel/parser": "^7.24.0", | ||
"@jridgewell/trace-mapping": "^0.3.25", | ||
"@rollup/plugin-alias": "^5.1.0", | ||
@@ -117,3 +117,3 @@ "@rollup/plugin-commonjs": "^25.0.7", | ||
"lightningcss": "^1.24.0", | ||
"magic-string": "^0.30.7", | ||
"magic-string": "^0.30.8", | ||
"micromatch": "^4.0.5", | ||
@@ -134,3 +134,3 @@ "mlly": "^1.6.1", | ||
"rollup-plugin-esbuild": "^6.1.1", | ||
"rollup-plugin-license": "^3.2.0", | ||
"rollup-plugin-license": "^3.3.1", | ||
"sirv": "^2.0.4", | ||
@@ -140,3 +140,3 @@ "source-map-support": "^0.5.21", | ||
"strip-literal": "^2.0.0", | ||
"tsconfck": "^3.0.2", | ||
"tsconfck": "^3.0.3", | ||
"tslib": "^2.6.2", | ||
@@ -143,0 +143,0 @@ "types": "link:./types", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3541602
91089
22
1
115