nuxt-community / router-extras-module

Extra Add-ons For Nuxt 2 Router
https://codesandbox.io/s/github/nuxt-community/router-extras-module
MIT License
279 stars 12 forks source link

windows environment Unable to update automatically router.js #156

Open 1415333545 opened 3 years ago

1415333545 commented 3 years ago

@nuxt/router-extras/lib/extras.js


function invalidateRoute (file) {
const routes = localRoutes.filter(route => route.component === file)
console.log(localRoutes[0].component) // => print like "D:\\hyp-test\\nuxt-test\\pages\\Home.vue"
console.log(file) // =>  print like "D:\hyp-test\nuxt-test\pages\Home.vue"
/* istanbul ignore next */
if (!routes.length) {
return false
}

const extras = extractExtrasFromRoute(routes[0], false)

return extras._needUpdate }

// Should need const routes = localRoutes.filter(route => normalize(route.component) === normalize(file))

trumpdo197 commented 3 years ago

I encountered the same bug on Windows. I tested your solution and it works. Consider creating a pull request? @1415333545