N
Nuxtβ€’2y ago
Fabian B.

Add custom files to watch for restarting nuxt (just like `nuxt.config.ts`)

Hi, in my nuxt.config.ts, I am importing some typescript files. When changing the nuxt.config.ts file, or e.g. the .env file of a project, nuxt gets restarted. I want to archive the same, so that when I edit one of the files imported, nuxt should also restart:
import { generateSitemap } from './generateSitemap'
import { cookieConfig } from './cookieConfig'

export default defineNuxtConfig({
// ...
})
import { generateSitemap } from './generateSitemap'
import { cookieConfig } from './cookieConfig'

export default defineNuxtConfig({
// ...
})
so in this case if either generateSitemap.ts or cookieConfig is edited, I want to restart the whole nuxt server.
5 Replies
plcdnl
plcdnlβ€’2y ago
did you find a solution ?
Fabian B.
Fabian B.OPβ€’2y ago
@plcdnl there was a PR two days ago that fixes this: https://github.com/nuxt/nuxt/pull/19530#issuecomment-1646964776
GitHub
feat(nuxt): add watch option and refactor dev server restarting b...
πŸ”— Linked issue ❓ Type of change πŸ“– Documentation (updates to the documentation or readme) 🐞 Bug fix (a non-breaking change that fixes an issue) πŸ‘Œ Enhancement (improving an existing functionality...
Fabian B.
Fabian B.OPβ€’2y ago
it’s not yet released though
manniL
manniLβ€’2y ago
Except on the edge channel 😁
Want results from more Discord servers?
Add your server