Skip to content

Commit

Permalink
fix: add explicit imports for server inlining plugin (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-confetti committed Mar 8, 2023
1 parent 5a9bb11 commit b4f6dc4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export default defineNuxtModule<ModuleOptions>({
filename: 'font-override-inlining-plugin.server.ts',
getContents: async () =>
[
`import { defineNuxtPlugin, useHead } from '#imports'`,
`const css = \`${(await css).replace(/\s+/g, ' ')}\``,
`export default defineNuxtPlugin(() => { useHead({ style: [{ children: css ${!nuxt.options.dev && options.inject ? '+ __INLINED_CSS__ ' : ''
}}] }) })`,
Expand Down

0 comments on commit b4f6dc4

Please sign in to comment.