vite 3.0.0-beta.1 → 3.0.0-beta.10
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.
- package/LICENSE.md +2 -340
- package/dist/client/client.mjs +11 -1
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-e8ca8d40.js → dep-07a79996.js} +121 -113
- package/dist/node/chunks/{dep-58d622b1.js → dep-41eb528c.js} +7 -7
- package/dist/node/chunks/{dep-077259ad.js → dep-7c75cb17.js} +33049 -32213
- package/dist/node/chunks/{dep-d0efd013.js → dep-af860ceb.js} +3119 -3119
- package/dist/node/chunks/dep-bc80f1d6.js +7545 -0
- package/dist/node/cli.js +13 -13
- package/dist/node/constants.js +23 -4
- package/dist/node/index.d.ts +134 -112
- package/dist/node/index.js +3 -3
- package/dist/node-cjs/publicUtils.cjs +1004 -963
- package/package.json +12 -13
- package/src/client/client.ts +16 -2
- package/src/client/tsconfig.json +0 -2
- package/dist/node/chunks/dep-35befe4f.js +0 -19615
- package/dist/node/chunks/dep-cd58a191.js +0 -7505
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"./client": {
|
|
21
21
|
"types": "./client.d.ts"
|
|
22
22
|
},
|
|
23
|
-
"./dist/client/*": "./dist/client/*"
|
|
23
|
+
"./dist/client/*": "./dist/client/*",
|
|
24
|
+
"./package.json": "./package.json"
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
26
27
|
"bin",
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"build-bundle": "rollup --config rollup.config.ts --configPlugin typescript",
|
|
49
50
|
"build-types": "run-s build-temp-types patch-types roll-types check-dist-types",
|
|
50
51
|
"build-temp-types": "tsc --emitDeclarationOnly --outDir temp/node -p src/node",
|
|
51
|
-
"patch-types": "
|
|
52
|
+
"patch-types": "tsx scripts/patchTypes.ts",
|
|
52
53
|
"roll-types": "api-extractor run && rimraf temp",
|
|
53
54
|
"check-dist-types": "tsc --project tsconfig.check.json",
|
|
54
55
|
"lint": "eslint --cache --ext .ts src/**",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
},
|
|
58
59
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
|
59
60
|
"dependencies": {
|
|
60
|
-
"esbuild": "^0.14.
|
|
61
|
+
"esbuild": "^0.14.47",
|
|
61
62
|
"postcss": "^8.4.14",
|
|
62
63
|
"resolve": "^1.22.1",
|
|
63
64
|
"rollup": "^2.75.6"
|
|
@@ -67,11 +68,11 @@
|
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@ampproject/remapping": "^2.2.0",
|
|
70
|
-
"@babel/parser": "^7.18.
|
|
71
|
-
"@babel/types": "^7.18.
|
|
72
|
-
"@jridgewell/trace-mapping": "^0.3.
|
|
71
|
+
"@babel/parser": "^7.18.8",
|
|
72
|
+
"@babel/types": "^7.18.8",
|
|
73
|
+
"@jridgewell/trace-mapping": "^0.3.14",
|
|
73
74
|
"@rollup/plugin-alias": "^3.1.9",
|
|
74
|
-
"@rollup/plugin-commonjs": "^
|
|
75
|
+
"@rollup/plugin-commonjs": "^22.0.1",
|
|
75
76
|
"@rollup/plugin-dynamic-import-vars": "^1.4.3",
|
|
76
77
|
"@rollup/plugin-json": "^4.1.0",
|
|
77
78
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
"cac": "^6.7.12",
|
|
83
84
|
"chokidar": "^3.5.3",
|
|
84
85
|
"connect": "^3.7.0",
|
|
85
|
-
"connect-history-api-fallback": "^
|
|
86
|
+
"connect-history-api-fallback": "^2.0.0",
|
|
86
87
|
"convert-source-map": "^1.8.0",
|
|
87
88
|
"cors": "^2.8.5",
|
|
88
89
|
"cross-spawn": "^7.0.3",
|
|
@@ -90,7 +91,6 @@
|
|
|
90
91
|
"dotenv": "^14.3.2",
|
|
91
92
|
"dotenv-expand": "^5.1.0",
|
|
92
93
|
"es-module-lexer": "^0.10.5",
|
|
93
|
-
"esno": "^0.16.3",
|
|
94
94
|
"estree-walker": "^3.0.1",
|
|
95
95
|
"etag": "^1.8.1",
|
|
96
96
|
"fast-glob": "^3.2.11",
|
|
@@ -99,9 +99,8 @@
|
|
|
99
99
|
"launch-editor-middleware": "^2.4.0",
|
|
100
100
|
"magic-string": "^0.26.2",
|
|
101
101
|
"micromatch": "^4.0.5",
|
|
102
|
-
"mlly": "^0.5.
|
|
102
|
+
"mlly": "^0.5.4",
|
|
103
103
|
"mrmime": "^1.0.1",
|
|
104
|
-
"node-forge": "^1.3.1",
|
|
105
104
|
"okie": "^1.0.1",
|
|
106
105
|
"open": "^8.4.0",
|
|
107
106
|
"periscopic": "^3.0.4",
|
|
@@ -119,7 +118,7 @@
|
|
|
119
118
|
"tsconfck": "^2.0.1",
|
|
120
119
|
"tslib": "^2.4.0",
|
|
121
120
|
"types": "link:./types",
|
|
122
|
-
"ufo": "^0.8.
|
|
121
|
+
"ufo": "^0.8.5",
|
|
123
122
|
"ws": "^8.8.0"
|
|
124
123
|
},
|
|
125
124
|
"peerDependencies": {
|
package/src/client/client.ts
CHANGED
|
@@ -7,9 +7,10 @@ import '@vite/env'
|
|
|
7
7
|
|
|
8
8
|
// injected by the hmr plugin when served
|
|
9
9
|
declare const __BASE__: string
|
|
10
|
+
declare const __SERVER_HOST__: string
|
|
10
11
|
declare const __HMR_PROTOCOL__: string | null
|
|
11
12
|
declare const __HMR_HOSTNAME__: string | null
|
|
12
|
-
declare const __HMR_PORT__:
|
|
13
|
+
declare const __HMR_PORT__: number | null
|
|
13
14
|
declare const __HMR_DIRECT_TARGET__: string
|
|
14
15
|
declare const __HMR_BASE__: string
|
|
15
16
|
declare const __HMR_TIMEOUT__: number
|
|
@@ -20,6 +21,7 @@ console.debug('[vite] connecting...')
|
|
|
20
21
|
const importMetaUrl = new URL(import.meta.url)
|
|
21
22
|
|
|
22
23
|
// use server configuration, then fallback to inference
|
|
24
|
+
const serverHost = __SERVER_HOST__
|
|
23
25
|
const socketProtocol =
|
|
24
26
|
__HMR_PROTOCOL__ || (location.protocol === 'https:' ? 'wss' : 'ws')
|
|
25
27
|
const hmrPort = __HMR_PORT__
|
|
@@ -38,7 +40,19 @@ try {
|
|
|
38
40
|
fallback = () => {
|
|
39
41
|
// fallback to connecting directly to the hmr server
|
|
40
42
|
// for servers which does not support proxying websocket
|
|
41
|
-
socket = setupWebSocket(socketProtocol, directSocketHost)
|
|
43
|
+
socket = setupWebSocket(socketProtocol, directSocketHost, () => {
|
|
44
|
+
const currentScriptHostURL = new URL(import.meta.url)
|
|
45
|
+
const currentScriptHost =
|
|
46
|
+
currentScriptHostURL.host +
|
|
47
|
+
currentScriptHostURL.pathname.replace(/@vite\/client$/, '')
|
|
48
|
+
console.error(
|
|
49
|
+
'[vite] failed to connect to websocket.\n' +
|
|
50
|
+
'your current setup:\n' +
|
|
51
|
+
` (browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)\n` +
|
|
52
|
+
` (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)\n` +
|
|
53
|
+
'Check out your Vite / network configuration and https://vitejs.dev/config/server-options.html#server-hmr .'
|
|
54
|
+
)
|
|
55
|
+
})
|
|
42
56
|
socket.addEventListener(
|
|
43
57
|
'open',
|
|
44
58
|
() => {
|