Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
fix: update client path + bump vite
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Jul 22, 2020
1 parent 2f4e600 commit ea635d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"vue-template-compiler": "^2.6.11"
},
"peerDependencies": {
"vite": ">=1.0.0-rc.1"
"vite": ">=1.0.0-rc.3"
},
"devDependencies": {
"@types/fs-extra": "^9.0.1",
Expand Down
3 changes: 2 additions & 1 deletion src/serverPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from 'vite/dist/node/server/serverPluginHmr'
import { srcImportMap } from 'vite/dist/node/server/serverPluginVue'
import { TemplateCompileOptions } from '@vue/component-compiler-utils/lib/compileTemplate'
import { clientPublicPath } from 'vite/dist/node/server/serverPluginClient'

const vueTemplateCompiler = require('vue-template-compiler')

Expand All @@ -38,7 +39,7 @@ export const vuePlugin: ServerPlugin = ({
config,
}) => {
app.use(async (ctx, next) => {
if (ctx.path === '/vite/hmr') {
if (ctx.path === clientPublicPath) {
await next()
ctx.type = 'js'
ctx.body = ctx.body.replace(
Expand Down

0 comments on commit ea635d2

Please sign in to comment.