ktsn / vue-template-loader

Vue.js 2.0 template loader for webpack
MIT License
266 stars 26 forks source link

Enable CompilerOptions.delimiters #35

Closed ytkj closed 7 years ago

ytkj commented 7 years ago

delimiters option is described as "only available in the full build."

But I want to use this option in runtime-only build vue.js library with vue-template-loader.

I think we can specify all the CompilerOptions to vue-template-compiler's compiler.compile(template, [options]) like:

compiler.compile(templte, {delimiters: ['${', '}']});

So, would you please add delimiters option to vue-template-loader ?

ktsn commented 7 years ago

Why do you want to use the delimiters option in compile time? To my understanding, it's the feature for avoiding to conflict with a server side template engine on runtime.

ytkj commented 7 years ago

In my product, I have a lot of document written in plain HTML. I want to migrate these HTML document to SPA.

One problem: Mustache {{ }} is used in many place to explain code snipet of AngularJS, Vue.js and so on.

Solution A: Use delimiters option. only one place to change.

Solution B: use v-pre directive. every code snipet to change.

To my understanding, it's the feature for avoiding to conflict with a server side template engine on runtime.

You argument make sence, and I realize this might be a rare usecase. So, please close if you think this option is unnecessary. Thanks.

ktsn commented 7 years ago

Sorry, I totally forgot about this issue. In my thought, as the official template compiler does not seems to be used in such use case, it should be avoided. I also think unifying the template format has an advantage (e.g. easy to implement static analyzing tools)

I think you should suggest about this in core vue repo at first 🙂

Closing this issue for now because of the above, but I probably reopen if the official compiler support it.