Skip to content

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

@iFwu

Description

@iFwu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions