Skip to content

Commit

Permalink
fix: skip processing some known libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Feb 21, 2024
1 parent 8399b32 commit 827409b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ interface FontFamilyInjectionPluginOptions {
resolveFontFace: (fontFamily: string) => Awaitable<NormalizedFontFaceData[] | undefined>
}

const SKIP_RE = /\/node_modules\/(vite-plugin-vue-inspector)\//

// TODO: support shared chunks of CSS
export const FontFamilyInjectionPlugin = (options: FontFamilyInjectionPluginOptions) => createUnplugin(() => {
return {
name: 'nuxt:fonts:font-family-injection',
transformInclude (id) {
return isCSS(id)
return isCSS(id) && !SKIP_RE.test(id)
},
async transform (code) {
// Early return if no font-family is used in this CSS
Expand Down

0 comments on commit 827409b

Please sign in to comment.