vite 2.9.14 → 2.9.16
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.
- package/dist/node/chunks/{dep-c9998dc6.js → dep-6e2fe41e.js} +42 -34
- package/dist/node/chunks/{dep-6e727db7.js → dep-9b59f0f3.js} +1 -1
- package/dist/node/chunks/{dep-de42cef2.js → dep-b60ba16f.js} +1 -1
- package/dist/node/chunks/{dep-99a2ccc8.js → dep-fbfb53e0.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/index.js +1 -1
- package/package.json +2 -2
|
@@ -36377,7 +36377,7 @@ const assetAttrsConfig = {
|
|
|
36377
36377
|
const isAsyncScriptMap = new WeakMap();
|
|
36378
36378
|
async function traverseHtml(html, filePath, visitor) {
|
|
36379
36379
|
// lazy load compiler
|
|
36380
|
-
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-
|
|
36380
|
+
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-9b59f0f3.js'); }).then(function (n) { return n.compilerDom_cjs; });
|
|
36381
36381
|
// @vue/compiler-core doesn't like lowercase doctypes
|
|
36382
36382
|
html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
|
|
36383
36383
|
try {
|
|
@@ -37434,7 +37434,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
37434
37434
|
replacer: urlReplacer
|
|
37435
37435
|
}));
|
|
37436
37436
|
if (isModule) {
|
|
37437
|
-
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-
|
|
37437
|
+
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-b60ba16f.js'); }).then(function (n) { return n.index; })).default({
|
|
37438
37438
|
...modulesOptions,
|
|
37439
37439
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
37440
37440
|
modules = _modules;
|
|
@@ -41283,7 +41283,7 @@ function ssrManifestPlugin(config) {
|
|
|
41283
41283
|
const code = chunk.code;
|
|
41284
41284
|
let imports;
|
|
41285
41285
|
try {
|
|
41286
|
-
imports = parse$e(code)[0].filter((i) => i.d > -1);
|
|
41286
|
+
imports = parse$e(code)[0].filter((i) => i.n && i.d > -1);
|
|
41287
41287
|
}
|
|
41288
41288
|
catch (e) {
|
|
41289
41289
|
this.error(e, e.idx);
|
|
@@ -48188,7 +48188,7 @@ async function getCertificate(cacheDir) {
|
|
|
48188
48188
|
return content;
|
|
48189
48189
|
}
|
|
48190
48190
|
catch {
|
|
48191
|
-
const content = (await Promise.resolve().then(function () { return require('./dep-
|
|
48191
|
+
const content = (await Promise.resolve().then(function () { return require('./dep-fbfb53e0.js'); })).createCertificate();
|
|
48192
48192
|
fs$n.promises
|
|
48193
48193
|
.mkdir(cacheDir, { recursive: true })
|
|
48194
48194
|
.then(() => fs$n.promises.writeFile(cachePath, content))
|
|
@@ -49775,32 +49775,36 @@ function serveStaticMiddleware(dir, server) {
|
|
|
49775
49775
|
isInternalRequest(req.url)) {
|
|
49776
49776
|
return next();
|
|
49777
49777
|
}
|
|
49778
|
-
const url =
|
|
49778
|
+
const url = new URL(req.url.replace(/^\/+/, '/'), 'http://example.com');
|
|
49779
|
+
const pathname = decodeURIComponent(url.pathname);
|
|
49779
49780
|
// apply aliases to static requests as well
|
|
49780
|
-
let
|
|
49781
|
+
let redirectedPathname;
|
|
49781
49782
|
for (const { find, replacement } of server.config.resolve.alias) {
|
|
49782
|
-
const matches = typeof find === 'string'
|
|
49783
|
+
const matches = typeof find === 'string'
|
|
49784
|
+
? pathname.startsWith(find)
|
|
49785
|
+
: find.test(pathname);
|
|
49783
49786
|
if (matches) {
|
|
49784
|
-
|
|
49787
|
+
redirectedPathname = pathname.replace(find, replacement);
|
|
49785
49788
|
break;
|
|
49786
49789
|
}
|
|
49787
49790
|
}
|
|
49788
|
-
if (
|
|
49791
|
+
if (redirectedPathname) {
|
|
49789
49792
|
// dir is pre-normalized to posix style
|
|
49790
|
-
if (
|
|
49791
|
-
|
|
49793
|
+
if (redirectedPathname.startsWith(dir)) {
|
|
49794
|
+
redirectedPathname = redirectedPathname.slice(dir.length);
|
|
49792
49795
|
}
|
|
49793
49796
|
}
|
|
49794
|
-
const
|
|
49795
|
-
let fileUrl = path__default.resolve(dir,
|
|
49796
|
-
if (
|
|
49797
|
+
const resolvedPathname = redirectedPathname || pathname;
|
|
49798
|
+
let fileUrl = path__default.resolve(dir, resolvedPathname.replace(/^\//, ''));
|
|
49799
|
+
if (resolvedPathname.endsWith('/') && !fileUrl.endsWith('/')) {
|
|
49797
49800
|
fileUrl = fileUrl + '/';
|
|
49798
49801
|
}
|
|
49799
49802
|
if (!ensureServingAccess(fileUrl, server, res, next)) {
|
|
49800
49803
|
return;
|
|
49801
49804
|
}
|
|
49802
|
-
if (
|
|
49803
|
-
|
|
49805
|
+
if (redirectedPathname) {
|
|
49806
|
+
url.pathname = encodeURIComponent(redirectedPathname);
|
|
49807
|
+
req.url = url.href.slice(url.origin.length);
|
|
49804
49808
|
}
|
|
49805
49809
|
serve(req, res, next);
|
|
49806
49810
|
};
|
|
@@ -49809,20 +49813,22 @@ function serveRawFsMiddleware(server) {
|
|
|
49809
49813
|
const serveFromRoot = sirv('/', sirvOptions(server.config.server.headers));
|
|
49810
49814
|
// Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
|
|
49811
49815
|
return function viteServeRawFsMiddleware(req, res, next) {
|
|
49812
|
-
|
|
49816
|
+
const url = new URL(req.url.replace(/^\/+/, '/'), 'http://example.com');
|
|
49813
49817
|
// In some cases (e.g. linked monorepos) files outside of root will
|
|
49814
49818
|
// reference assets that are also out of served root. In such cases
|
|
49815
49819
|
// the paths are rewritten to `/@fs/` prefixed paths and must be served by
|
|
49816
49820
|
// searching based from fs root.
|
|
49817
|
-
if (url.startsWith(FS_PREFIX)) {
|
|
49821
|
+
if (url.pathname.startsWith(FS_PREFIX)) {
|
|
49822
|
+
const pathname = decodeURIComponent(url.pathname);
|
|
49818
49823
|
// restrict files outside of `fs.allow`
|
|
49819
|
-
if (!ensureServingAccess(slash(path__default.resolve(fsPathFromId(
|
|
49824
|
+
if (!ensureServingAccess(slash(path__default.resolve(fsPathFromId(pathname))), server, res, next)) {
|
|
49820
49825
|
return;
|
|
49821
49826
|
}
|
|
49822
|
-
|
|
49827
|
+
let newPathname = pathname.slice(FS_PREFIX.length);
|
|
49823
49828
|
if (isWindows$3)
|
|
49824
|
-
|
|
49825
|
-
|
|
49829
|
+
newPathname = newPathname.replace(/^[A-Z]:/i, '');
|
|
49830
|
+
url.pathname = encodeURIComponent(newPathname);
|
|
49831
|
+
req.url = url.href.slice(url.origin.length);
|
|
49826
49832
|
serveFromRoot(req, res, next);
|
|
49827
49833
|
}
|
|
49828
49834
|
else {
|
|
@@ -53093,7 +53099,7 @@ const http$3 = require$$1__default$1;
|
|
|
53093
53099
|
const net = require$$3__default;
|
|
53094
53100
|
const tls = require$$4__default;
|
|
53095
53101
|
const { randomBytes, createHash: createHash$1 } = require$$1__default$2;
|
|
53096
|
-
const { URL: URL$
|
|
53102
|
+
const { URL: URL$2 } = require$$0__default$5;
|
|
53097
53103
|
|
|
53098
53104
|
const PerMessageDeflate$1 = permessageDeflate;
|
|
53099
53105
|
const Receiver = receiver;
|
|
@@ -53747,12 +53753,12 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
53747
53753
|
|
|
53748
53754
|
let parsedUrl;
|
|
53749
53755
|
|
|
53750
|
-
if (address instanceof URL$
|
|
53756
|
+
if (address instanceof URL$2) {
|
|
53751
53757
|
parsedUrl = address;
|
|
53752
53758
|
websocket._url = address.href;
|
|
53753
53759
|
} else {
|
|
53754
53760
|
try {
|
|
53755
|
-
parsedUrl = new URL$
|
|
53761
|
+
parsedUrl = new URL$2(address);
|
|
53756
53762
|
} catch (e) {
|
|
53757
53763
|
throw new SyntaxError(`Invalid URL: ${address}`);
|
|
53758
53764
|
}
|
|
@@ -53945,7 +53951,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
53945
53951
|
let addr;
|
|
53946
53952
|
|
|
53947
53953
|
try {
|
|
53948
|
-
addr = new URL$
|
|
53954
|
+
addr = new URL$2(location, address);
|
|
53949
53955
|
} catch (e) {
|
|
53950
53956
|
const err = new SyntaxError(`Invalid URL: ${location}`);
|
|
53951
53957
|
emitErrorAndClose(websocket, err);
|
|
@@ -55948,7 +55954,7 @@ var debug_1 = function () {
|
|
|
55948
55954
|
};
|
|
55949
55955
|
|
|
55950
55956
|
var url = require$$0__default$5;
|
|
55951
|
-
var URL = url.URL;
|
|
55957
|
+
var URL$1 = url.URL;
|
|
55952
55958
|
var http$1 = require$$1__default$1;
|
|
55953
55959
|
var https$1 = require$$1__default$3;
|
|
55954
55960
|
var Writable = require$$0__default$3.Writable;
|
|
@@ -56399,14 +56405,14 @@ function wrap(protocols) {
|
|
|
56399
56405
|
if (typeof input === "string") {
|
|
56400
56406
|
var urlStr = input;
|
|
56401
56407
|
try {
|
|
56402
|
-
input = urlToOptions(new URL(urlStr));
|
|
56408
|
+
input = urlToOptions(new URL$1(urlStr));
|
|
56403
56409
|
}
|
|
56404
56410
|
catch (err) {
|
|
56405
56411
|
/* istanbul ignore next */
|
|
56406
56412
|
input = url.parse(urlStr);
|
|
56407
56413
|
}
|
|
56408
56414
|
}
|
|
56409
|
-
else if (URL && (input instanceof URL)) {
|
|
56415
|
+
else if (URL$1 && (input instanceof URL$1)) {
|
|
56410
56416
|
input = urlToOptions(input);
|
|
56411
56417
|
}
|
|
56412
56418
|
else {
|
|
@@ -61896,7 +61902,6 @@ async function loadConfigFromFile(configEnv, configFile, configRoot = process.cw
|
|
|
61896
61902
|
try {
|
|
61897
61903
|
let userConfig;
|
|
61898
61904
|
if (isESM) {
|
|
61899
|
-
const fileUrl = require('url').pathToFileURL(resolvedPath);
|
|
61900
61905
|
const bundled = await bundleConfigFile(resolvedPath, true);
|
|
61901
61906
|
dependencies = bundled.dependencies;
|
|
61902
61907
|
if (isTS) {
|
|
@@ -61904,13 +61909,16 @@ async function loadConfigFromFile(configEnv, configFile, configRoot = process.cw
|
|
|
61904
61909
|
// with --experimental-loader themselves, we have to do a hack here:
|
|
61905
61910
|
// bundle the config file w/ ts transforms first, write it to disk,
|
|
61906
61911
|
// load it with native Node ESM, then delete the file.
|
|
61907
|
-
|
|
61908
|
-
|
|
61909
|
-
|
|
61910
|
-
fs__default.
|
|
61912
|
+
const fileBase = `${resolvedPath}.timestamp-${Date.now()}`;
|
|
61913
|
+
const fileNameTmp = `${fileBase}.js`;
|
|
61914
|
+
const fileUrl = `${require('url').pathToFileURL(fileBase)}.js`;
|
|
61915
|
+
fs__default.writeFileSync(fileNameTmp, bundled.code);
|
|
61916
|
+
userConfig = (await dynamicImport(fileUrl)).default;
|
|
61917
|
+
fs__default.unlinkSync(fileNameTmp);
|
|
61911
61918
|
debug(`TS + native esm config loaded in ${getTime()}`, fileUrl);
|
|
61912
61919
|
}
|
|
61913
61920
|
else {
|
|
61921
|
+
const fileUrl = require('url').pathToFileURL(resolvedPath);
|
|
61914
61922
|
// using Function to avoid this from being compiled away by TS/Rollup
|
|
61915
61923
|
// append a query so that we force reload fresh config in case of
|
|
61916
61924
|
// server restart
|
package/dist/node/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var perf_hooks = require('perf_hooks');
|
|
4
4
|
var require$$0 = require('events');
|
|
5
|
-
var index = require('./chunks/dep-
|
|
5
|
+
var index = require('./chunks/dep-6e2fe41e.js');
|
|
6
6
|
require('fs');
|
|
7
7
|
require('path');
|
|
8
8
|
require('url');
|
|
@@ -683,7 +683,7 @@ cli
|
|
|
683
683
|
.action(async (root, options) => {
|
|
684
684
|
// output structure is preserved even after bundling so require()
|
|
685
685
|
// is ok here
|
|
686
|
-
const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-
|
|
686
|
+
const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-6e2fe41e.js'); }).then(function (n) { return n.index$1; });
|
|
687
687
|
try {
|
|
688
688
|
const server = await createServer({
|
|
689
689
|
root,
|
|
@@ -732,7 +732,7 @@ cli
|
|
|
732
732
|
.option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
|
|
733
733
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
734
734
|
.action(async (root, options) => {
|
|
735
|
-
const { build } = await Promise.resolve().then(function () { return require('./chunks/dep-
|
|
735
|
+
const { build } = await Promise.resolve().then(function () { return require('./chunks/dep-6e2fe41e.js'); }).then(function (n) { return n.build$1; });
|
|
736
736
|
const buildOptions = cleanOptions(options);
|
|
737
737
|
try {
|
|
738
738
|
await build({
|
|
@@ -755,7 +755,7 @@ cli
|
|
|
755
755
|
.command('optimize [root]', 'pre-bundle dependencies')
|
|
756
756
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
757
757
|
.action(async (root, options) => {
|
|
758
|
-
const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-
|
|
758
|
+
const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-6e2fe41e.js'); }).then(function (n) { return n.index; });
|
|
759
759
|
try {
|
|
760
760
|
const config = await index.resolveConfig({
|
|
761
761
|
root,
|
|
@@ -778,7 +778,7 @@ cli
|
|
|
778
778
|
.option('--https', `[boolean] use TLS + HTTP/2`)
|
|
779
779
|
.option('--open [path]', `[boolean | string] open browser on startup`)
|
|
780
780
|
.action(async (root, options) => {
|
|
781
|
-
const { preview } = await Promise.resolve().then(function () { return require('./chunks/dep-
|
|
781
|
+
const { preview } = await Promise.resolve().then(function () { return require('./chunks/dep-6e2fe41e.js'); }).then(function (n) { return n.preview$1; });
|
|
782
782
|
try {
|
|
783
783
|
const server = await preview({
|
|
784
784
|
root,
|
package/dist/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Evan You",
|
|
6
6
|
"description": "Native-ESM powered web dev build tool",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"esbuild": "^0.14.27",
|
|
47
47
|
"postcss": "^8.4.13",
|
|
48
48
|
"resolve": "^1.22.0",
|
|
49
|
-
"rollup": "
|
|
49
|
+
"rollup": ">=2.59.0 <2.78.0"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
52
|
"fsevents": "~2.3.2"
|