Closed kennardconsulting closed 6 years ago
We can't add the feature which vue-template-compiler does not support.
Sorry for not being clear. I believe preserveWhitespace
is already supported by vue-template-compiler
. As explained here:
I think I just need you to expose it?
We can expose the option, but preserveWhitespace: false
does not trim text nodes but eliminate whitespace between elements.
https://jsfiddle.net/m5zyuvux/
Thanks for being so responsive!
I take your point. I understand now that this won't solve my problem. It may be useful to expose it for now anyway, and hopefully expose some other option in the future (preserveWhitespaceWithinElements
or something).
It's actually a correctness issue, I think.
Investigating this some more, I've realized that - for my use case - it would be sufficient to chain the loader with something that can strip the whitespace. However (possibly because of the inline/normal/post loader thing) I don't seem to be able to do this:
test: /\.html$/,
use: [ {
loader: 'html-loader',
options: {
minimize: true
}
}, 'vue-template-loader' ]
The vue-template-loader
ignores the html-loader
. Is there a way to make this work?
Thanks for all your hard work on vue-template-loader!
Would it be possible to expose the
preserveWhitespace
option as discussed here: https://github.com/vuejs/vue/issues/3934At present my input looks like this:
And my output looks like this:
_c('p',[_vm._v("\r\n\t\tMy gross annual salary is\r\n\t\t")
I would love it to look like this:
_c('p',[_vm._v("My gross annual salary is")