fix(vite): normalize paths before comparing (#763)

Co-Authored-By: Anthony Fu <hi@antfu.me>
This commit is contained in:
Pooya Parsa 2021-10-12 16:42:44 +02:00
parent d41c034af7
commit 3c132a8de0

View File

@ -1,4 +1,4 @@
import { resolve } from 'pathe'
import { resolve, normalize } from 'pathe'
import * as vite from 'vite'
import vuePlugin from '@vitejs/plugin-vue'
import fse from 'fs-extra'
@ -117,6 +117,7 @@ export async function buildServer (ctx: ViteBuildContext) {
// Watch
viteServer.watcher.on('all', (_event, file) => {
file = normalize(file) // Fix windows paths
if (file.indexOf(ctx.nuxt.options.buildDir) === 0) { return }
doBuild()
})