vue-template-compiler-loader
vue-template-compiler-loader copied to clipboard
Suggestion: use 'vue-loader/lib/template-compiler' instead
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.