types(compiler-sfc): use specific preprocessLang instead of string (#528)
This commit is contained in:
parent
9b5c4a2ec1
commit
55e234816e
@ -5,7 +5,8 @@ import scopedPlugin from './stylePluginScoped'
|
|||||||
import {
|
import {
|
||||||
processors,
|
processors,
|
||||||
StylePreprocessor,
|
StylePreprocessor,
|
||||||
StylePreprocessorResults
|
StylePreprocessorResults,
|
||||||
|
PreprocessLang
|
||||||
} from './stylePreprocessors'
|
} from './stylePreprocessors'
|
||||||
|
|
||||||
export interface StyleCompileOptions {
|
export interface StyleCompileOptions {
|
||||||
@ -15,7 +16,7 @@ export interface StyleCompileOptions {
|
|||||||
map?: object
|
map?: object
|
||||||
scoped?: boolean
|
scoped?: boolean
|
||||||
trim?: boolean
|
trim?: boolean
|
||||||
preprocessLang?: string
|
preprocessLang?: PreprocessLang
|
||||||
preprocessOptions?: any
|
preprocessOptions?: any
|
||||||
postcssOptions?: any
|
postcssOptions?: any
|
||||||
postcssPlugins?: any[]
|
postcssPlugins?: any[]
|
||||||
|
@ -104,7 +104,9 @@ const styl: StylePreprocessor = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const processors: Record<string, StylePreprocessor> = {
|
export type PreprocessLang = 'less' | 'sass' | 'scss' | 'styl' | 'stylus'
|
||||||
|
|
||||||
|
export const processors: Record<PreprocessLang, StylePreprocessor> = {
|
||||||
less,
|
less,
|
||||||
sass,
|
sass,
|
||||||
scss,
|
scss,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user