Skip to content

Commit

Permalink
fix: updateType may contains extra & (vitejs#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsonet authored May 26, 2020
1 parent 0ce1eef commit 301d7a3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/node/server/serverPluginVue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,17 @@ export const vuePlugin: ServerPlugin = ({
})
}

if (needRerender || didUpdateStyle) {
let updateType = needRerender ? `template` : ``
if (didUpdateStyle) {
updateType += ` & style`
}
let updateType = []
if (needRerender) {
updateType.push(`template`)
}
if (didUpdateStyle) {
updateType.push(`style`)
}
if (updateType.length) {
console.log(
chalk.green(`[vite:hmr] `) +
`${path.relative(root, file)} updated. (${updateType})`
`${path.relative(root, file)} updated. (${updateType.join(' & ')})`
)
}
})
Expand Down

0 comments on commit 301d7a3

Please sign in to comment.