types(compiler-sfc): use specific preprocessLang instead of string (#528)

This commit is contained in:
Pocho 2019-12-10 03:19:39 +08:00 committed by Evan You
parent 9b5c4a2ec1
commit 55e234816e
2 changed files with 6 additions and 3 deletions

View File

@ -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[]

View File

@ -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,