vite 4.2.0 → 4.2.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.
|
@@ -16024,7 +16024,7 @@ const debug$e = createDebugger('vite:sourcemap', {
|
|
|
16024
16024
|
// Virtual modules should be prefixed with a null byte to avoid a
|
|
16025
16025
|
// false positive "missing source" warning. We also check for certain
|
|
16026
16026
|
// prefixes used for special handling in esbuildDepPlugin.
|
|
16027
|
-
const virtualSourceRE = /^(
|
|
16027
|
+
const virtualSourceRE = /^(?:dep:|browser-external:|virtual:)|\0/;
|
|
16028
16028
|
async function injectSourcesContent(map, file, logger) {
|
|
16029
16029
|
let sourceRoot;
|
|
16030
16030
|
try {
|
|
@@ -22466,18 +22466,31 @@ function webWorkerPlugin(config) {
|
|
|
22466
22466
|
getDepsOptimizer(config, ssr)?.registerWorkersSource(id);
|
|
22467
22467
|
if (query.inline != null) {
|
|
22468
22468
|
const chunk = await bundleWorkerEntry(config, id, query);
|
|
22469
|
-
|
|
22469
|
+
const encodedJs = `const encodedJs = "${Buffer.from(chunk.code).toString('base64')}";`;
|
|
22470
|
+
const code =
|
|
22471
|
+
// Using blob URL for SharedWorker results in multiple instances of a same worker
|
|
22472
|
+
workerConstructor === 'Worker'
|
|
22473
|
+
? `${encodedJs}
|
|
22474
|
+
const blob = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs)], { type: "text/javascript;charset=utf-8" });
|
|
22475
|
+
export default function WorkerWrapper() {
|
|
22476
|
+
let objURL;
|
|
22477
|
+
try {
|
|
22478
|
+
objURL = blob && (window.URL || window.webkitURL).createObjectURL(blob);
|
|
22479
|
+
if (!objURL) throw ''
|
|
22480
|
+
return new ${workerConstructor}(objURL)
|
|
22481
|
+
} catch(e) {
|
|
22482
|
+
return new ${workerConstructor}("data:application/javascript;base64," + encodedJs${workerOptions});
|
|
22483
|
+
} finally {
|
|
22484
|
+
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
22485
|
+
}
|
|
22486
|
+
}`
|
|
22487
|
+
: `${encodedJs}
|
|
22488
|
+
export default function WorkerWrapper() {
|
|
22489
|
+
return new ${workerConstructor}("data:application/javascript;base64," + encodedJs${workerOptions});
|
|
22490
|
+
}
|
|
22491
|
+
`;
|
|
22470
22492
|
return {
|
|
22471
|
-
code
|
|
22472
|
-
const blob = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs)], { type: "text/javascript;charset=utf-8" });
|
|
22473
|
-
export default function WorkerWrapper() {
|
|
22474
|
-
const objURL = blob && (window.URL || window.webkitURL).createObjectURL(blob);
|
|
22475
|
-
try {
|
|
22476
|
-
return objURL ? new ${workerConstructor}(objURL) : new ${workerConstructor}("data:application/javascript;base64," + encodedJs${workerOptions});
|
|
22477
|
-
} finally {
|
|
22478
|
-
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
22479
|
-
}
|
|
22480
|
-
}`,
|
|
22493
|
+
code,
|
|
22481
22494
|
// Empty sourcemap to suppress Rollup warning
|
|
22482
22495
|
map: { mappings: '' },
|
|
22483
22496
|
};
|
|
@@ -37899,7 +37912,9 @@ function cssPostPlugin(config) {
|
|
|
37899
37912
|
const getContentWithSourcemap = async (content) => {
|
|
37900
37913
|
if (config.css?.devSourcemap) {
|
|
37901
37914
|
const sourcemap = this.getCombinedSourcemap();
|
|
37902
|
-
|
|
37915
|
+
if (sourcemap.mappings && !sourcemap.sourcesContent) {
|
|
37916
|
+
await injectSourcesContent(sourcemap, cleanUrl(id), config.logger);
|
|
37917
|
+
}
|
|
37903
37918
|
return getCodeWithSourcemap('css', content, sourcemap);
|
|
37904
37919
|
}
|
|
37905
37920
|
return content;
|
|
@@ -38306,7 +38321,7 @@ async function compileCSS(id, code, config, urlReplacer) {
|
|
|
38306
38321
|
}));
|
|
38307
38322
|
}
|
|
38308
38323
|
if (isModule) {
|
|
38309
|
-
postcssPlugins.unshift((await import('./dep-
|
|
38324
|
+
postcssPlugins.unshift((await import('./dep-f63b56ae.js').then(function (n) { return n.i; })).default({
|
|
38310
38325
|
...modulesOptions,
|
|
38311
38326
|
localsConvention: modulesOptions?.localsConvention,
|
|
38312
38327
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import require$$0__default from 'fs';
|
|
2
2
|
import require$$0 from 'postcss';
|
|
3
|
-
import { C as commonjsGlobal } from './dep-
|
|
3
|
+
import { C as commonjsGlobal } from './dep-79892de8.js';
|
|
4
4
|
import require$$0$1 from 'path';
|
|
5
5
|
import require$$5 from 'crypto';
|
|
6
6
|
import require$$0$2 from 'util';
|
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 picocolorsExports, B as bindShortcuts, w as createLogger, h as resolveConfig } from './chunks/dep-
|
|
5
|
+
import { A as picocolorsExports, B as bindShortcuts, w as createLogger, h as resolveConfig } from './chunks/dep-79892de8.js';
|
|
6
6
|
import { VERSION } from './constants.js';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'node:module';
|
|
@@ -729,7 +729,7 @@ cli
|
|
|
729
729
|
filterDuplicateOptions(options);
|
|
730
730
|
// output structure is preserved even after bundling so require()
|
|
731
731
|
// is ok here
|
|
732
|
-
const { createServer } = await import('./chunks/dep-
|
|
732
|
+
const { createServer } = await import('./chunks/dep-79892de8.js').then(function (n) { return n.F; });
|
|
733
733
|
try {
|
|
734
734
|
const server = await createServer({
|
|
735
735
|
root,
|
|
@@ -807,7 +807,7 @@ cli
|
|
|
807
807
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
808
808
|
.action(async (root, options) => {
|
|
809
809
|
filterDuplicateOptions(options);
|
|
810
|
-
const { build } = await import('./chunks/dep-
|
|
810
|
+
const { build } = await import('./chunks/dep-79892de8.js').then(function (n) { return n.E; });
|
|
811
811
|
const buildOptions = cleanOptions(options);
|
|
812
812
|
try {
|
|
813
813
|
await build({
|
|
@@ -835,7 +835,7 @@ cli
|
|
|
835
835
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
836
836
|
.action(async (root, options) => {
|
|
837
837
|
filterDuplicateOptions(options);
|
|
838
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
|
838
|
+
const { optimizeDeps } = await import('./chunks/dep-79892de8.js').then(function (n) { return n.D; });
|
|
839
839
|
try {
|
|
840
840
|
const config = await resolveConfig({
|
|
841
841
|
root,
|
|
@@ -860,7 +860,7 @@ cli
|
|
|
860
860
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
|
861
861
|
.action(async (root, options) => {
|
|
862
862
|
filterDuplicateOptions(options);
|
|
863
|
-
const { preview } = await import('./chunks/dep-
|
|
863
|
+
const { preview } = await import('./chunks/dep-79892de8.js').then(function (n) { return n.G; });
|
|
864
864
|
try {
|
|
865
865
|
const server = await preview({
|
|
866
866
|
root,
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as build, e as buildErrorMessage, u as createFilter, w as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, j as getDepOptimizationConfig, k as isDepsOptimizerEnabled, l as loadConfigFromFile, y as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, i as resolveBaseUrl, h as resolveConfig, z as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, x as searchForWorkspaceRoot, v as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
|
1
|
+
export { b as build, e as buildErrorMessage, u as createFilter, w as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, j as getDepOptimizationConfig, k as isDepsOptimizerEnabled, l as loadConfigFromFile, y as loadEnv, q as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, i as resolveBaseUrl, h as resolveConfig, z as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, x as searchForWorkspaceRoot, v as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-79892de8.js';
|
|
2
2
|
export { VERSION as version } from './constants.js';
|
|
3
3
|
export { version as esbuildVersion } from 'esbuild';
|
|
4
4
|
export { VERSION as rollupVersion } from 'rollup';
|