mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
fix(vite): normalize paths before comparing (#763)
Co-Authored-By: Anthony Fu <hi@antfu.me>
This commit is contained in:
parent
d41c034af7
commit
3c132a8de0
@ -1,4 +1,4 @@
|
|||||||
import { resolve } from 'pathe'
|
import { resolve, normalize } from 'pathe'
|
||||||
import * as vite from 'vite'
|
import * as vite from 'vite'
|
||||||
import vuePlugin from '@vitejs/plugin-vue'
|
import vuePlugin from '@vitejs/plugin-vue'
|
||||||
import fse from 'fs-extra'
|
import fse from 'fs-extra'
|
||||||
@ -117,6 +117,7 @@ export async function buildServer (ctx: ViteBuildContext) {
|
|||||||
|
|
||||||
// Watch
|
// Watch
|
||||||
viteServer.watcher.on('all', (_event, file) => {
|
viteServer.watcher.on('all', (_event, file) => {
|
||||||
|
file = normalize(file) // Fix windows paths
|
||||||
if (file.indexOf(ctx.nuxt.options.buildDir) === 0) { return }
|
if (file.indexOf(ctx.nuxt.options.buildDir) === 0) { return }
|
||||||
doBuild()
|
doBuild()
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user