Skip to content

Commit e1c4c15

Browse files
committed
perf: do not include nuxt-og-image templates
1 parent b96774a commit e1c4c15

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

modules/og-image.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineNuxtModule, useNuxt } from 'nuxt/kit'
2+
3+
export default defineNuxtModule({
4+
meta: {
5+
name: 'og-image-tweaks',
6+
},
7+
setup() {
8+
const nuxt = useNuxt()
9+
10+
nuxt.hook('components:extend', components => {
11+
for (const component of [...components].toReversed()) {
12+
if (component.filePath.includes('og-image')) {
13+
components.splice(components.indexOf(component), 1)
14+
}
15+
}
16+
})
17+
},
18+
})

0 commit comments

Comments
 (0)