Skip to content

Commit

Permalink
fix: add runtime dir to nitro inline array
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 13, 2023
1 parent 652c7be commit cf097c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default defineNuxtModule<ModuleOptions>({
configKey: 'security'
},
setup (options, nuxt) {
// TODO: Migrate to createResolver (from @nuxt/kit)
const runtimeDir = fileURLToPath(new URL('./runtime', import.meta.url))
nuxt.options.build.transpile.push(runtimeDir)
nuxt.options.security = defuReplaceArray(nuxt.options.security, {
Expand All @@ -49,6 +50,7 @@ export default defineNuxtModule<ModuleOptions>({
if (securityOptions.hidePoweredBy) {
nuxt.hook('nitro:config', (config) => {
config.plugins = config.plugins || []
config.externals.inline.push(normalize(fileURLToPath(new URL('./runtime', import.meta.url))))
config.plugins.push(
normalize(fileURLToPath(new URL('./runtime/nitro', import.meta.url)))
)
Expand Down

0 comments on commit cf097c5

Please sign in to comment.