feat!: set whitespace: 'condense' for template compiler (#3853)

BREAKING CHANGE:
Detailed explanation: https://github.com/vuejs/vue/issues/9208#issuecomment-450012518

Take the following template as example:
```
<p>
  Welcome to <b>Vue.js</b> <i>world</i>.
  Have fun!
</p>
```

With `preserveWhitespace: false`, it was compiled as:
```
<p> Welcome to <b>Vue.js</b><i>world</i>. Have fun! </p>
```

With `whitespace: 'condense'`, it is now compiled as:
```
<p> Welcome to <b>Vue.js</b> <i>world</i>. Have fun! </p>
```

Note the **inline whitespace between tags** is preserved.

Closes #1020
This commit is contained in:
Haoqun Jiang
2019-04-22 21:02:05 +08:00
parent b70e0f6970
commit 678bfc6b2d

View File

@@ -86,7 +86,7 @@ module.exports = (api, options) => {
.loader('vue-loader')
.options(Object.assign({
compilerOptions: {
preserveWhitespace: false
whitespace: 'condense'
}
}, vueLoaderCacheConfig))