Expose preserveWhitespace to vue-template-loader
See original GitHub issueThanks 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/3934
At present my input looks like this:
<p>
My gross annual salary is
</p>
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")
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Options Reference - Vue Loader
During template compilation, the compiler can transform certain ... or discard whitespaces between template tags with { preserveWhitespace: false } .
Read more >perserveWhitespace: false · Issue #1020 · vuejs/vue-cli - GitHub
preserveWhitespace : false White space is an expected design pattern ... can configure it by tapping vue-loader 's option in vue.config.js .
Read more >Spaces are gone in HTML after upgrading to vue-cli 3
You can configure the vue-loader's template compiler option preserveWhitespace to true using the vue.config.js file
Read more >vue-template-compiler | Yarn - Package Manager
This package can be used to pre-compile Vue 2.0 templates into render functions to avoid runtime-compilation overhead and CSP restrictions.
Read more >Using vue-loader to create single-page applications
Setting up our new Vue.js project · vue-loader and vue-template-compiler transpile Vue files into JavaScript · babel-loader converts ES6 code to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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:
The
vue-template-loader
ignores thehtml-loader
. Is there a way to make this work?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.