From 97076fa64961ee69ada9f2fafd17b88aa52604e7 Mon Sep 17 00:00:00 2001 From: Dax Chen Date: Sun, 13 Aug 2017 17:00:05 +0800 Subject: [PATCH 1/2] 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) } From 90b19e098a8596ee13f8472578cfa01e9357df1c Mon Sep 17 00:00:00 2001 From: Dax Chen Date: Sun, 13 Aug 2017 17:03:34 +0800 Subject: [PATCH 2/2] use single quotes --- lib/builder/webpack/vue-loader.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/builder/webpack/vue-loader.config.js b/lib/builder/webpack/vue-loader.config.js index d840434f46..385fa49425 100644 --- a/lib/builder/webpack/vue-loader.config.js +++ b/lib/builder/webpack/vue-loader.config.js @@ -22,7 +22,7 @@ export default function ({ isClient }) { }, template: { // for pug, see https://github.com/vuejs/vue-loader/issues/55 - doctype: "html" + doctype: 'html' }, preserveWhitespace: false, extractCSS: extractStyles.call(this)