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
<template lang="pug">
foo(
  bar
  v-baz-directive
)
</template>
```

This will be rendered as
`<foo bar="bar" v-baz-directive="v-baz-directive">`
and cause errors such as `bar expected Boolean but got String` and `v`/`baz`/`directive` not defined.
This commit is contained in:
Dax Chen 2017-08-13 17:00:05 +08:00 committed by GitHub
parent 61111c87f0
commit 97076fa649

View File

@ -20,6 +20,10 @@ export default function ({ isClient }) {
'stylus': styleLoader.call(this, 'stylus', 'stylus-loader'), 'stylus': styleLoader.call(this, 'stylus', 'stylus-loader'),
'styl': 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, preserveWhitespace: false,
extractCSS: extractStyles.call(this) extractCSS: extractStyles.call(this)
} }