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 {
|
||||
processors,
|
||||
StylePreprocessor,
|
||||
StylePreprocessorResults
|
||||
StylePreprocessorResults,
|
||||
PreprocessLang
|
||||
} from './stylePreprocessors'
|
||||
|
||||
export interface StyleCompileOptions {
|
||||
@ -15,7 +16,7 @@ export interface StyleCompileOptions {
|
||||
map?: object
|
||||
scoped?: boolean
|
||||
trim?: boolean
|
||||
preprocessLang?: string
|
||||
preprocessLang?: PreprocessLang
|
||||
preprocessOptions?: any
|
||||
postcssOptions?: 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,
|
||||
sass,
|
||||
scss,
|
||||
|
Loading…
Reference in New Issue
Block a user