]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types(compiler-sfc): use specific preprocessLang instead of string (#528)
authorPocho <13343460801@163.com>
Mon, 9 Dec 2019 19:19:39 +0000 (03:19 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 9 Dec 2019 19:19:39 +0000 (14:19 -0500)
packages/compiler-sfc/src/compileStyle.ts
packages/compiler-sfc/src/stylePreprocessors.ts

index b61c46f36b630dfea527f70f241fa1b4f5e50bf1..25b8d419c0739d852718e050b04422e4678b1a3f 100644 (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[]
index e391c6b7dca3a240d62e4522a390686e09ef35cc..2c7b370282896f13f8e544bd47bb9c02eead0a41 100644 (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,