N
Nuxtβ€’3mo ago
βˆ‚Max

No hot reload for runtime/plugin when developing custom nuxt content transformer

Hello πŸ‘‹ While developing a custom nuxt/content transformer, I found myself having an annoying problem... Hot reload doesn't work for my runtime/plugin file... I followed the documentation at https://content.nuxt.com/recipes/transformers and have the following module.ts:
import { defineNuxtModule, createResolver, addComponentsDir } from '@nuxt/kit'

export default defineNuxtModule({
meta: {
name: 'my-module',
configKey: 'myModule',
},
// Default configuration options of the Nuxt module
defaults: {},
setup(_options, _nuxt) {
const { resolve } = createResolver(import.meta.url)

_nuxt.options.nitro.externals = _nuxt.options.nitro.externals || {}
_nuxt.options.nitro.externals.inline = _nuxt.options.nitro.externals.inline || []
_nuxt.options.nitro.externals.inline.push(resolve('./module'))

_nuxt.hook('content:context', (contentContext) => {
contentContext.transformers.push(resolve('./runtime/plugin.ts'))
})
},
})
import { defineNuxtModule, createResolver, addComponentsDir } from '@nuxt/kit'

export default defineNuxtModule({
meta: {
name: 'my-module',
configKey: 'myModule',
},
// Default configuration options of the Nuxt module
defaults: {},
setup(_options, _nuxt) {
const { resolve } = createResolver(import.meta.url)

_nuxt.options.nitro.externals = _nuxt.options.nitro.externals || {}
_nuxt.options.nitro.externals.inline = _nuxt.options.nitro.externals.inline || []
_nuxt.options.nitro.externals.inline.push(resolve('./module'))

_nuxt.hook('content:context', (contentContext) => {
contentContext.transformers.push(resolve('./runtime/plugin.ts'))
})
},
})
Thanks in advance for your help!
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server