From 97076fa64961ee69ada9f2fafd17b88aa52604e7 Mon Sep 17 00:00:00 2001 From: Dax Chen Date: Sun, 13 Aug 2017 17:00:05 +0800 Subject: [PATCH] Add better support for pug When using `lang="pug"`, passing Boolean `true` as prop and using directives will case errors. See: https://github.com/vuejs/vue-loader/issues/693 https://github.com/vuejs/vue-loader/issues/55 For example: ```html ``` This will be rendered as `` and cause errors such as `bar expected Boolean but got String` and `v`/`baz`/`directive` not defined. --- lib/builder/webpack/vue-loader.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/builder/webpack/vue-loader.config.js b/lib/builder/webpack/vue-loader.config.js index 659eded04b..d840434f46 100644 --- a/lib/builder/webpack/vue-loader.config.js +++ b/lib/builder/webpack/vue-loader.config.js @@ -20,6 +20,10 @@ export default function ({ isClient }) { 'stylus': styleLoader.call(this, 'stylus', 'stylus-loader'), 'styl': styleLoader.call(this, 'stylus', 'stylus-loader') }, + template: { + // for pug, see https://github.com/vuejs/vue-loader/issues/55 + doctype: "html" + }, preserveWhitespace: false, extractCSS: extractStyles.call(this) }