We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
processCSSVariables
1 parent a3be9a1 commit d89e67cCopy full SHA for d89e67c
packages/fontless/src/vite.ts
@@ -75,13 +75,12 @@ export function fontless(_options?: FontlessOptions): Plugin {
75
id: {
76
include: [CSS_EXTENSIONS_RE, CSS_LANG_QUERY_RE, INLINE_STYLE_ID_RE],
77
},
78
+ code: {
79
+ // Early return if no font-family is used in this CSS
80
+ exclude: !options.processCSSVariables ? [/^(?!.*font-family\s*:).*$/s] : undefined,
81
+ },
82
83
async handler(code, id) {
- // Early return if no font-family is used in this CSS
- if (!options.processCSSVariables && !code.includes('font-family:')) {
- return
- }
84
-
85
const s = await transformCSS(cssTransformOptions, code, id)
86
87
if (s.hasChanged()) {
0 commit comments