fix(cli): restart on app.vue creation and removal (#597)

This commit is contained in:
Sébastien Chopin 2021-09-29 20:09:43 +02:00 committed by GitHub
parent f79f6fe40f
commit 0b8ae9abdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,6 +62,12 @@ export default defineNuxtCommand({
if (file.match(/nuxt\.config\.(js|ts|mjs|cjs)$|pages$/)) {
dLoad(true, `${relative(rootDir, file)} updated`)
}
if (['addDir', 'unlinkDir'].includes(_event) && file.match(/pages$/)) {
dLoad(true, `pages/ ${_event === 'addDir' ? 'created' : 'removed'}`)
}
if (['add', 'unlink'].includes(_event) && file.match(/app\.(js|ts|mjs|jsx|tsx|vue)$/)) {
dLoad(true, `${relative(rootDir, file)}/ ${_event === 'add' ? 'created' : 'removed'}`)
}
})
await load(false)