mirror of
https://github.com/vuejs/vue.git
synced 2024-11-21 20:28:54 +00:00
build: move cssVars logic into compiler-sfc entry
This commit is contained in:
parent
d3916b69b4
commit
0f2cede374
@ -10,6 +10,7 @@ import {
|
||||
import hash from 'hash-sum'
|
||||
import LRU from 'lru-cache'
|
||||
import { hmrShouldReload } from './compileScript'
|
||||
import { parseCssVars } from './cssVars'
|
||||
|
||||
const cache = new LRU<string, SFCDescriptor>(100)
|
||||
|
||||
@ -57,6 +58,10 @@ export function parse(options: SFCParseOptions): SFCDescriptor {
|
||||
}
|
||||
|
||||
output.filename = filename
|
||||
|
||||
// parse CSS vars
|
||||
output.cssVars = parseCssVars(output)
|
||||
|
||||
output.shouldForceReload = prevImports =>
|
||||
hmrShouldReload(prevImports, output!)
|
||||
|
||||
|
@ -4,7 +4,6 @@ import { makeMap } from 'shared/util'
|
||||
import { ASTAttr, WarningMessage } from 'types/compiler'
|
||||
import { BindingMetadata, RawSourceMap } from './types'
|
||||
import type { ImportBinding } from './compileScript'
|
||||
import { parseCssVars } from './cssVars'
|
||||
|
||||
export const DEFAULT_FILENAME = 'anonymous.vue'
|
||||
|
||||
@ -209,8 +208,5 @@ export function parseComponent(
|
||||
outputSourceRange: options.outputSourceRange
|
||||
})
|
||||
|
||||
// parse CSS vars
|
||||
sfc.cssVars = parseCssVars(sfc)
|
||||
|
||||
return sfc
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user