vue-template-compiler-loader icon indicating copy to clipboard operation
vue-template-compiler-loader copied to clipboard

Suggestion: use 'vue-loader/lib/template-compiler' instead

Open iFwu opened this issue 6 years ago • 0 comments

Hello, Thanks for giving a good example of how vue-template-compiler can work with Webpack. Howerver, I explored vue-loader's repo and found this template compiler code, it's actually the same logic with your implement. Using the loader below, the vue teamplate can be compiled by webpack and use by injecting tpl.render (like your example).

rules: [
…
  {
        test: [/\.html$/, /\.tpl$/],
        include: /src/,
        loader: 'vue-loader/lib/template-compiler',
  }
…
]

In such way, you can optimize the render function, e.g. SSR performance.

iFwu avatar Sep 01 '17 14:09 iFwu