File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export function compileTemplate(
42
42
if ( preprocessor ) {
43
43
return actuallyCompile (
44
44
Object . assign ( { } , options , {
45
- source : preprocess ( options , preprocessor )
45
+ source : preprocess ( options , preprocessor , preprocessLang as string )
46
46
} )
47
47
)
48
48
} else if ( preprocessLang ) {
@@ -65,16 +65,24 @@ export function compileTemplate(
65
65
}
66
66
}
67
67
68
+ function getDefaultPreprocessOptions ( preprocessLang : string ) : any {
69
+ const defaultPreprocessOptions : any = { pug : { doctype : 'html' } }
70
+
71
+ return defaultPreprocessOptions [ preprocessLang ] || { }
72
+ }
73
+
68
74
function preprocess (
69
75
options : TemplateCompileOptions ,
70
- preprocessor : any
76
+ preprocessor : any ,
77
+ preprocessLang : string
71
78
) : string {
72
79
const { source, filename, preprocessOptions } = options
73
80
74
81
const finalPreprocessOptions = Object . assign (
75
82
{
76
83
filename
77
84
} ,
85
+ getDefaultPreprocessOptions ( preprocessLang ) ,
78
86
preprocessOptions
79
87
)
80
88
You can’t perform that action at this time.
0 commit comments