Skip to content

Commit

Permalink
chore: remove components/content directory registeration
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Nov 1, 2024
1 parent 7a97c69 commit da3a6d6
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mkdir, readFile, stat } from 'node:fs/promises'
import { mkdir, readFile } from 'node:fs/promises'
import {
defineNuxtModule,
createResolver,
Expand Down Expand Up @@ -154,23 +154,6 @@ export default defineNuxtModule<ModuleOptions>({
nuxt.options.routeRules![`/api/content/${collection.name}/database.sql`] = { prerender: true }
}
})
// Register user global components
const _layers = [...nuxt.options._layers].reverse()
for (const layer of _layers) {
const srcDir = layer.config.srcDir
const globalComponents = resolver.resolve(srcDir, 'components/content')
const dirStat = await stat(globalComponents).catch(() => null)
if (dirStat && dirStat.isDirectory()) {
nuxt.hook('components:dirs', (dirs) => {
dirs.unshift({
path: globalComponents,
global: true,
pathPrefix: false,
prefix: '',
})
})
}
}

await installMDCModule(options, nuxt)

Expand Down

0 comments on commit da3a6d6

Please sign in to comment.