vite 2.8.0-beta.3 → 2.8.0-beta.4
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/CHANGELOG.md +20 -1
- package/LICENSE.md +3 -3
- package/dist/client/client.mjs +10 -5
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-6f0b746c.js → dep-2451c479.js} +1 -1
- package/dist/node/chunks/{dep-84e12b4e.js → dep-4ef300ce.js} +1 -1
- package/dist/node/chunks/{dep-885d4c21.js → dep-778bed46.js} +1 -1
- package/dist/node/chunks/{dep-a5ab6d86.js → dep-7b4d034a.js} +717 -1480
- package/dist/node/cli.js +4 -4
- package/dist/node/index.js +1 -1
- package/package.json +3 -3
- package/src/client/client.ts +12 -6
package/dist/node/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var require$$0 = require('events');
|
|
4
|
-
var build = require('./chunks/dep-
|
|
4
|
+
var build = require('./chunks/dep-7b4d034a.js');
|
|
5
5
|
var perf_hooks = require('perf_hooks');
|
|
6
6
|
require('fs');
|
|
7
7
|
require('path');
|
|
@@ -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-7b4d034a.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: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-
|
|
735
|
+
const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-7b4d034a.js'); }).then(function (n) { return n.build$1; });
|
|
736
736
|
const buildOptions = cleanOptions(options);
|
|
737
737
|
try {
|
|
738
738
|
await build$1({
|
|
@@ -755,7 +755,7 @@ cli
|
|
|
755
755
|
.command('optimize [root]')
|
|
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-7b4d034a.js'); }).then(function (n) { return n.index; });
|
|
759
759
|
try {
|
|
760
760
|
const config = await build.resolveConfig({
|
|
761
761
|
root,
|
package/dist/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "2.8.0-beta.
|
|
3
|
+
"version": "2.8.0-beta.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Evan You",
|
|
6
6
|
"description": "Native-ESM powered web dev build tool",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"cors": "^2.8.5",
|
|
88
88
|
"cross-spawn": "^7.0.3",
|
|
89
89
|
"debug": "^4.3.3",
|
|
90
|
-
"dotenv": "^
|
|
90
|
+
"dotenv": "^14.3.2",
|
|
91
91
|
"dotenv-expand": "^5.1.0",
|
|
92
92
|
"es-module-lexer": "^0.9.3",
|
|
93
93
|
"estree-walker": "^2.0.2",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"resolve.exports": "^1.1.0",
|
|
111
111
|
"rollup-plugin-license": "^2.6.0",
|
|
112
112
|
"sirv": "^2.0.0",
|
|
113
|
-
"source-map": "^0.
|
|
113
|
+
"source-map-js": "^1.0.2",
|
|
114
114
|
"source-map-support": "^0.5.21",
|
|
115
115
|
"strip-ansi": "^6.0.1",
|
|
116
116
|
"terser": "^5.10.0",
|
package/src/client/client.ts
CHANGED
|
@@ -39,6 +39,12 @@ function warnFailedFetch(err: Error, path: string | string[]) {
|
|
|
39
39
|
)
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
function cleanUrl(pathname: string): string {
|
|
43
|
+
const url = new URL(pathname, location.toString())
|
|
44
|
+
url.searchParams.delete('direct')
|
|
45
|
+
return url.pathname + url.search
|
|
46
|
+
}
|
|
47
|
+
|
|
42
48
|
// Listen for messages
|
|
43
49
|
socket.addEventListener('message', async ({ data }) => {
|
|
44
50
|
handleMessage(JSON.parse(data))
|
|
@@ -73,21 +79,21 @@ async function handleMessage(payload: HMRPayload) {
|
|
|
73
79
|
} else {
|
|
74
80
|
// css-update
|
|
75
81
|
// this is only sent when a css file referenced with <link> is updated
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
const { path, timestamp } = update
|
|
83
|
+
const searchUrl = cleanUrl(path)
|
|
78
84
|
// can't use querySelector with `[href*=]` here since the link may be
|
|
79
85
|
// using relative paths so we need to use link.href to grab the full
|
|
80
86
|
// URL for the include check.
|
|
81
87
|
const el = Array.from(
|
|
82
88
|
document.querySelectorAll<HTMLLinkElement>('link')
|
|
83
|
-
).find((e) => e.href.includes(
|
|
89
|
+
).find((e) => cleanUrl(e.href).includes(searchUrl))
|
|
84
90
|
if (el) {
|
|
85
|
-
const newPath = `${base}${
|
|
86
|
-
|
|
91
|
+
const newPath = `${base}${searchUrl.slice(1)}${
|
|
92
|
+
searchUrl.includes('?') ? '&' : '?'
|
|
87
93
|
}t=${timestamp}`
|
|
88
94
|
el.href = new URL(newPath, el.href).href
|
|
89
95
|
}
|
|
90
|
-
console.log(`[vite] css hot updated: ${
|
|
96
|
+
console.log(`[vite] css hot updated: ${searchUrl}`)
|
|
91
97
|
}
|
|
92
98
|
})
|
|
93
99
|
break
|