Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(dev-cache): hot reload for documentDriven: false #2686

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,11 @@ export default defineNuxtModule<ModuleOptions>({
addImports({ name: 'navigationDisabled', as: 'fetchContentNavigation', from: resolveRuntimeModule('./composables/utils') })
}

// Enable hot reload for dev server
if (nuxt.options.dev) {
addServerPlugin(resolveRuntimeModule("./server/plugins/refresh-cache"));
}

// Register document-driven
if (options.documentDriven) {
// Enable every feature by default
Expand Down Expand Up @@ -443,9 +448,6 @@ export default defineNuxtModule<ModuleOptions>({
? './plugins/documentDriven'
: './legacy/plugins/documentDriven'
))
if (nuxt.options.dev) {
addServerPlugin(resolveRuntimeModule("./server/plugins/refresh-cache"));
}

if (options.documentDriven.injectPage) {
nuxt.options.pages = true
Expand Down
Loading