Skip to content

Commit 0f2cede

Browse files
committed
build: move cssVars logic into compiler-sfc entry
1 parent d3916b6 commit 0f2cede

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: packages/compiler-sfc/src/parse.ts

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import hash from 'hash-sum'
1111
import LRU from 'lru-cache'
1212
import { hmrShouldReload } from './compileScript'
13+
import { parseCssVars } from './cssVars'
1314

1415
const cache = new LRU<string, SFCDescriptor>(100)
1516

@@ -57,6 +58,10 @@ export function parse(options: SFCParseOptions): SFCDescriptor {
5758
}
5859

5960
output.filename = filename
61+
62+
// parse CSS vars
63+
output.cssVars = parseCssVars(output)
64+
6065
output.shouldForceReload = prevImports =>
6166
hmrShouldReload(prevImports, output!)
6267

Diff for: packages/compiler-sfc/src/parseComponent.ts

-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { makeMap } from 'shared/util'
44
import { ASTAttr, WarningMessage } from 'types/compiler'
55
import { BindingMetadata, RawSourceMap } from './types'
66
import type { ImportBinding } from './compileScript'
7-
import { parseCssVars } from './cssVars'
87

98
export const DEFAULT_FILENAME = 'anonymous.vue'
109

@@ -209,8 +208,5 @@ export function parseComponent(
209208
outputSourceRange: options.outputSourceRange
210209
})
211210

212-
// parse CSS vars
213-
sfc.cssVars = parseCssVars(sfc)
214-
215211
return sfc
216212
}

0 commit comments

Comments
 (0)