vite 4.2.1 → 4.2.3
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,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-f2591f42.js';
|
|
4
4
|
import require$$0$1 from 'path';
|
|
5
5
|
import require$$5 from 'crypto';
|
|
6
6
|
import require$$0$2 from 'util';
|
|
@@ -38321,7 +38321,7 @@ async function compileCSS(id, code, config, urlReplacer) {
|
|
|
38321
38321
|
}));
|
|
38322
38322
|
}
|
|
38323
38323
|
if (isModule) {
|
|
38324
|
-
postcssPlugins.unshift((await import('./dep-
|
|
38324
|
+
postcssPlugins.unshift((await import('./dep-5f263e17.js').then(function (n) { return n.i; })).default({
|
|
38325
38325
|
...modulesOptions,
|
|
38326
38326
|
localsConvention: modulesOptions?.localsConvention,
|
|
38327
38327
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
@@ -40770,6 +40770,83 @@ function sirv (dir, opts={}) {
|
|
|
40770
40770
|
};
|
|
40771
40771
|
}
|
|
40772
40772
|
|
|
40773
|
+
/*!
|
|
40774
|
+
* escape-html
|
|
40775
|
+
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
40776
|
+
* Copyright(c) 2015 Andreas Lubbe
|
|
40777
|
+
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
40778
|
+
* MIT Licensed
|
|
40779
|
+
*/
|
|
40780
|
+
|
|
40781
|
+
/**
|
|
40782
|
+
* Module variables.
|
|
40783
|
+
* @private
|
|
40784
|
+
*/
|
|
40785
|
+
|
|
40786
|
+
var matchHtmlRegExp = /["'&<>]/;
|
|
40787
|
+
|
|
40788
|
+
/**
|
|
40789
|
+
* Module exports.
|
|
40790
|
+
* @public
|
|
40791
|
+
*/
|
|
40792
|
+
|
|
40793
|
+
var escapeHtml_1 = escapeHtml$1;
|
|
40794
|
+
|
|
40795
|
+
/**
|
|
40796
|
+
* Escape special characters in the given string of html.
|
|
40797
|
+
*
|
|
40798
|
+
* @param {string} string The string to escape for inserting into HTML
|
|
40799
|
+
* @return {string}
|
|
40800
|
+
* @public
|
|
40801
|
+
*/
|
|
40802
|
+
|
|
40803
|
+
function escapeHtml$1(string) {
|
|
40804
|
+
var str = '' + string;
|
|
40805
|
+
var match = matchHtmlRegExp.exec(str);
|
|
40806
|
+
|
|
40807
|
+
if (!match) {
|
|
40808
|
+
return str;
|
|
40809
|
+
}
|
|
40810
|
+
|
|
40811
|
+
var escape;
|
|
40812
|
+
var html = '';
|
|
40813
|
+
var index = 0;
|
|
40814
|
+
var lastIndex = 0;
|
|
40815
|
+
|
|
40816
|
+
for (index = match.index; index < str.length; index++) {
|
|
40817
|
+
switch (str.charCodeAt(index)) {
|
|
40818
|
+
case 34: // "
|
|
40819
|
+
escape = '"';
|
|
40820
|
+
break;
|
|
40821
|
+
case 38: // &
|
|
40822
|
+
escape = '&';
|
|
40823
|
+
break;
|
|
40824
|
+
case 39: // '
|
|
40825
|
+
escape = ''';
|
|
40826
|
+
break;
|
|
40827
|
+
case 60: // <
|
|
40828
|
+
escape = '<';
|
|
40829
|
+
break;
|
|
40830
|
+
case 62: // >
|
|
40831
|
+
escape = '>';
|
|
40832
|
+
break;
|
|
40833
|
+
default:
|
|
40834
|
+
continue;
|
|
40835
|
+
}
|
|
40836
|
+
|
|
40837
|
+
if (lastIndex !== index) {
|
|
40838
|
+
html += str.substring(lastIndex, index);
|
|
40839
|
+
}
|
|
40840
|
+
|
|
40841
|
+
lastIndex = index + 1;
|
|
40842
|
+
html += escape;
|
|
40843
|
+
}
|
|
40844
|
+
|
|
40845
|
+
return lastIndex !== index
|
|
40846
|
+
? html + str.substring(lastIndex, index)
|
|
40847
|
+
: html;
|
|
40848
|
+
}
|
|
40849
|
+
|
|
40773
40850
|
const sirvOptions = ({ headers, shouldServe, }) => {
|
|
40774
40851
|
return {
|
|
40775
40852
|
dev: true,
|
|
@@ -40823,7 +40900,7 @@ function serveStaticMiddleware(dir, server) {
|
|
|
40823
40900
|
isInternalRequest(req.url)) {
|
|
40824
40901
|
return next();
|
|
40825
40902
|
}
|
|
40826
|
-
const url = new URL(req.url, 'http://example.com');
|
|
40903
|
+
const url = new URL(req.url.replace(/^\/+/, '/'), 'http://example.com');
|
|
40827
40904
|
const pathname = decodeURIComponent(url.pathname);
|
|
40828
40905
|
// apply aliases to static requests as well
|
|
40829
40906
|
let redirectedPathname;
|
|
@@ -40861,7 +40938,7 @@ function serveRawFsMiddleware(server) {
|
|
|
40861
40938
|
const serveFromRoot = sirv('/', sirvOptions({ headers: server.config.server.headers }));
|
|
40862
40939
|
// Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
|
|
40863
40940
|
return function viteServeRawFsMiddleware(req, res, next) {
|
|
40864
|
-
const url = new URL(req.url, 'http://example.com');
|
|
40941
|
+
const url = new URL(req.url.replace(/^\/+/, '/'), 'http://example.com');
|
|
40865
40942
|
// In some cases (e.g. linked monorepos) files outside of root will
|
|
40866
40943
|
// reference assets that are also out of served root. In such cases
|
|
40867
40944
|
// the paths are rewritten to `/@fs/` prefixed paths and must be served by
|
|
@@ -40925,7 +41002,7 @@ function renderRestrictedErrorHTML(msg) {
|
|
|
40925
41002
|
return html `
|
|
40926
41003
|
<body>
|
|
40927
41004
|
<h1>403 Restricted</h1>
|
|
40928
|
-
<p>${msg.replace(/\n/g, '<br/>')}</p>
|
|
41005
|
+
<p>${escapeHtml_1(msg).replace(/\n/g, '<br/>')}</p>
|
|
40929
41006
|
<style>
|
|
40930
41007
|
body {
|
|
40931
41008
|
padding: 1em 2em;
|
|
@@ -47523,83 +47600,6 @@ function encodeUrl$1 (url) {
|
|
|
47523
47600
|
.replace(ENCODE_CHARS_REGEXP, encodeURI)
|
|
47524
47601
|
}
|
|
47525
47602
|
|
|
47526
|
-
/*!
|
|
47527
|
-
* escape-html
|
|
47528
|
-
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
47529
|
-
* Copyright(c) 2015 Andreas Lubbe
|
|
47530
|
-
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
47531
|
-
* MIT Licensed
|
|
47532
|
-
*/
|
|
47533
|
-
|
|
47534
|
-
/**
|
|
47535
|
-
* Module variables.
|
|
47536
|
-
* @private
|
|
47537
|
-
*/
|
|
47538
|
-
|
|
47539
|
-
var matchHtmlRegExp = /["'&<>]/;
|
|
47540
|
-
|
|
47541
|
-
/**
|
|
47542
|
-
* Module exports.
|
|
47543
|
-
* @public
|
|
47544
|
-
*/
|
|
47545
|
-
|
|
47546
|
-
var escapeHtml_1 = escapeHtml$1;
|
|
47547
|
-
|
|
47548
|
-
/**
|
|
47549
|
-
* Escape special characters in the given string of html.
|
|
47550
|
-
*
|
|
47551
|
-
* @param {string} string The string to escape for inserting into HTML
|
|
47552
|
-
* @return {string}
|
|
47553
|
-
* @public
|
|
47554
|
-
*/
|
|
47555
|
-
|
|
47556
|
-
function escapeHtml$1(string) {
|
|
47557
|
-
var str = '' + string;
|
|
47558
|
-
var match = matchHtmlRegExp.exec(str);
|
|
47559
|
-
|
|
47560
|
-
if (!match) {
|
|
47561
|
-
return str;
|
|
47562
|
-
}
|
|
47563
|
-
|
|
47564
|
-
var escape;
|
|
47565
|
-
var html = '';
|
|
47566
|
-
var index = 0;
|
|
47567
|
-
var lastIndex = 0;
|
|
47568
|
-
|
|
47569
|
-
for (index = match.index; index < str.length; index++) {
|
|
47570
|
-
switch (str.charCodeAt(index)) {
|
|
47571
|
-
case 34: // "
|
|
47572
|
-
escape = '"';
|
|
47573
|
-
break;
|
|
47574
|
-
case 38: // &
|
|
47575
|
-
escape = '&';
|
|
47576
|
-
break;
|
|
47577
|
-
case 39: // '
|
|
47578
|
-
escape = ''';
|
|
47579
|
-
break;
|
|
47580
|
-
case 60: // <
|
|
47581
|
-
escape = '<';
|
|
47582
|
-
break;
|
|
47583
|
-
case 62: // >
|
|
47584
|
-
escape = '>';
|
|
47585
|
-
break;
|
|
47586
|
-
default:
|
|
47587
|
-
continue;
|
|
47588
|
-
}
|
|
47589
|
-
|
|
47590
|
-
if (lastIndex !== index) {
|
|
47591
|
-
html += str.substring(lastIndex, index);
|
|
47592
|
-
}
|
|
47593
|
-
|
|
47594
|
-
lastIndex = index + 1;
|
|
47595
|
-
html += escape;
|
|
47596
|
-
}
|
|
47597
|
-
|
|
47598
|
-
return lastIndex !== index
|
|
47599
|
-
? html + str.substring(lastIndex, index)
|
|
47600
|
-
: html;
|
|
47601
|
-
}
|
|
47602
|
-
|
|
47603
47603
|
var onFinishedExports = {};
|
|
47604
47604
|
var onFinished$2 = {
|
|
47605
47605
|
get exports(){ return onFinishedExports; },
|
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-f2591f42.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-f2591f42.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-f2591f42.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-f2591f42.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-f2591f42.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-f2591f42.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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"@rollup/plugin-node-resolve": "15.0.1",
|
|
87
87
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
88
88
|
"@rollup/pluginutils": "^5.0.2",
|
|
89
|
+
"@types/escape-html": "^1.0.0",
|
|
89
90
|
"acorn": "^8.8.2",
|
|
90
91
|
"acorn-walk": "^8.2.0",
|
|
91
92
|
"cac": "^6.7.14",
|
|
@@ -100,6 +101,7 @@
|
|
|
100
101
|
"dotenv": "^16.0.3",
|
|
101
102
|
"dotenv-expand": "^9.0.0",
|
|
102
103
|
"es-module-lexer": "^1.2.0",
|
|
104
|
+
"escape-html": "^1.0.3",
|
|
103
105
|
"estree-walker": "^3.0.3",
|
|
104
106
|
"etag": "^1.8.1",
|
|
105
107
|
"fast-glob": "^3.2.12",
|