From: Pocho <13343460801@163.com> Date: Mon, 9 Dec 2019 19:19:39 +0000 (+0800) Subject: types(compiler-sfc): use specific preprocessLang instead of string (#528) X-Git-Tag: v3.0.0-alpha.0~90 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55e234816ee31891b755d4a28ceb5aca6f396eb6;p=thirdparty%2Fvuejs%2Fcore.git types(compiler-sfc): use specific preprocessLang instead of string (#528) --- diff --git a/packages/compiler-sfc/src/compileStyle.ts b/packages/compiler-sfc/src/compileStyle.ts index b61c46f36b..25b8d419c0 100644 --- a/packages/compiler-sfc/src/compileStyle.ts +++ b/packages/compiler-sfc/src/compileStyle.ts @@ -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[] diff --git a/packages/compiler-sfc/src/stylePreprocessors.ts b/packages/compiler-sfc/src/stylePreprocessors.ts index e391c6b7dc..2c7b370282 100644 --- a/packages/compiler-sfc/src/stylePreprocessors.ts +++ b/packages/compiler-sfc/src/stylePreprocessors.ts @@ -104,7 +104,9 @@ const styl: StylePreprocessor = { } } -export const processors: Record = { +export type PreprocessLang = 'less' | 'sass' | 'scss' | 'styl' | 'stylus' + +export const processors: Record = { less, sass, scss,