Skip to content

Commit 991a443

Browse files
committed
fix: vite 2.0.0-beta.2 compat
1 parent 65f8a2e commit 991a443

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"dependencies": {
6666
"@docsearch/css": "^1.0.0-alpha.28",
6767
"@docsearch/js": "^1.0.0-alpha.28",
68-
"@vitejs/plugin-vue": "^1.0.2",
68+
"@vitejs/plugin-vue": "^1.0.3",
6969
"@vue/compiler-sfc": "^3.0.5",
7070
"@vue/server-renderer": "^3.0.5",
7171
"chalk": "^4.1.0",
@@ -88,7 +88,7 @@
8888
"prismjs": "^1.20.0",
8989
"sirv": "^1.0.10",
9090
"slash": "^3.0.0",
91-
"vite": "^2.0.0-alpha.5",
91+
"vite": "^2.0.0-beta.2",
9292
"vue": "^3.0.5"
9393
},
9494
"devDependencies": {

src/node/plugin.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ export function createVitePressPlugin(
138138
}
139139
},
140140

141-
async handleHotUpdate(file, mods, read, server) {
141+
async handleHotUpdate(ctx) {
142142
// handle config hmr
143+
const { file, read, server } = ctx
143144
if (file === configPath) {
144145
const newData = await resolveSiteData(root)
145146
if (newData.base !== siteData.base) {
@@ -167,7 +168,10 @@ export function createVitePressPlugin(
167168
})
168169

169170
// reload the content component
170-
return vuePlugin.handleHotUpdate!(file, mods, () => vueSrc, server)
171+
return vuePlugin.handleHotUpdate!({
172+
...ctx,
173+
read: () => vueSrc
174+
})
171175
}
172176
}
173177
}

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -948,10 +948,10 @@
948948
dependencies:
949949
"@types/yargs-parser" "*"
950950

951-
"@vitejs/plugin-vue@^1.0.2":
952-
version "1.0.2"
953-
resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.0.2.tgz#46da003df81c5ef74cec6d59c16fa13c34bd8108"
954-
integrity sha512-qtmVCJ3MfGebpbRIK/UFydlEuvDrz5Z4caARXDWWy23bM6nFq7wIV6/tW4LRdmSHxFdyvogctQ1+zl4brJg1og==
951+
"@vitejs/plugin-vue@^1.0.3":
952+
version "1.0.3"
953+
resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.0.3.tgz#2df3c22802f2d2142ae3bd8d3e93623df790446d"
954+
integrity sha512-sOVHFS97zxuRLAMj10C9Vaiv3WeEwnhtee9V+yv/G/xoJTXPJIRct4Nj2unPtp5zAUoCL+iTVbIC6LnNmNE4Hw==
955955

956956
957957
version "3.0.5"
@@ -6031,10 +6031,10 @@ [email protected]:
60316031
core-util-is "1.0.2"
60326032
extsprintf "^1.2.0"
60336033

6034-
vite@^2.0.0-alpha.5:
6035-
version "2.0.0-alpha.5"
6036-
resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-alpha.5.tgz#e7e840c0caafbc3d1264efb7b7cf5f08000bff24"
6037-
integrity sha512-cRm1/ZlcmIcl43ehvxs5Hr+5WapCYe3Zf4i6GM0a+VJPUgE0SJFzEO/SgZhJEc7PINmo+4TXKWAokZU+XvvwoA==
6034+
vite@^2.0.0-beta.2:
6035+
version "2.0.0-beta.2"
6036+
resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.2.tgz#5ea8fd4a01d0f722db59bff2bdc4ae24ba9fa63a"
6037+
integrity sha512-bZ2IeW+Uo4A7HpRIqyyHUDk6/WOGIkNdTm5/0yLmgjvXgLErwUhzv7Z0T0C6lc4lwoQV9KEA8IbFkZ+ZyWzhWg==
60386038
dependencies:
60396039
esbuild "^0.8.26"
60406040
postcss "^8.2.1"

0 commit comments

Comments
 (0)