Skip to content

Commit

Permalink
fix(plugin-vue): default pug doctype
Browse files Browse the repository at this point in the history
fix #1383
  • Loading branch information
yyx990803 committed Jan 6, 2021
1 parent 135d508 commit 667637f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/plugin-vue/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ export function resolveTemplateCompilerOptions(
transformAssetUrls = assetUrlOptions
}

let preprocessOptions = block.lang && options.template?.preprocessOptions
if (block.lang === 'pug') {
preprocessOptions = {
doctype: 'html',
...preprocessOptions
}
}

return {
...options.template,
id,
Expand All @@ -144,7 +152,7 @@ export function resolveTemplateCompilerOptions(
ssrCssVars: cssVars,
transformAssetUrls,
preprocessLang: block.lang,
preprocessOptions: block.lang && options.template?.preprocessOptions,
preprocessOptions,
compilerOptions: {
...options.template?.compilerOptions,
scopeId: hasScoped ? `data-v-${id}` : undefined,
Expand Down

0 comments on commit 667637f

Please sign in to comment.