{"id":22282,"library":"rollup-plugin-vue-template-compiler","title":"rollup-plugin-vue-template-compiler","description":"Rollup plugin for compiling Vue.js 2.0 templates into render functions using vue-template-compiler. Version 1.0.3 is the latest stable release; no active development since 2017. It allows importing .html files as compiled template objects (render and staticRenderFns) with support for include/exclude patterns. Compared to alternative solutions like rollup-plugin-vue (which handles full SFC compilation) this plugin focuses solely on template compilation and works with plain HTML files.","status":"maintenance","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/fergaldoyle/rollup-plugin-vue-template-compiler","tags":["javascript"],"install":[{"cmd":"npm install rollup-plugin-vue-template-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-vue-template-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-vue-template-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for template compilation; must be Vue 2.x","package":"vue-template-compiler","optional":false}],"imports":[{"note":"ESM default export; plugin is used in Rollup config","wrong":"const vueTemplateCompiler = require('rollup-plugin-vue-template-compiler')","symbol":"default","correct":"import vueTemplateCompiler from 'rollup-plugin-vue-template-compiler'"}],"quickstart":{"code":"// rollup.config.js\nimport vueTemplateCompiler from 'rollup-plugin-vue-template-compiler';\nimport buble from 'rollup-plugin-buble';\n\nexport default {\n  input: 'src/main.js',\n  output: { file: 'dist/bundle.js', format: 'iife' },\n  plugins: [\n    vueTemplateCompiler({ include: '**/*.html' }),\n    buble()\n  ]\n};\n\n// main.js\nimport template from './template.html';\n\nconst App = {\n  render: template.render,\n  staticRenderFns: template.staticRenderFns,\n  mounted() { console.log('mounted'); }\n};\n\nnew Vue({\n  el: '#app',\n  render: h => h(App)\n});","lang":"javascript","description":"Configures Rollup plugin to compile Vue 2 templates from .html files and import them as render functions."},"warnings":[{"fix":"Use vue3 compatible plugin like rollup-plugin-vue for Vue 3.","message":"Requires Vue 2.x; incompatible with Vue 3.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider rollup-plugin-vue or @vue/compiler-sfc for modern Vue projects.","message":"Package is no longer actively maintained; last release in 2017.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install --save-dev vue-template-compiler@^2.0.0","cause":"vue-template-compiler is a peer dependency not automatically installed.","error":"Error: Cannot find module 'vue-template-compiler'"},{"fix":"Use rollup.config.mjs or run with --experimental-modules or transpile config via @rollup/plugin-babel.","cause":"Rollup config uses import statements but is not compiled by Node (e.g., without .mjs extension).","error":"SyntaxError: Unexpected token 'export' (maybe: Rollup config using ESM without bundling)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}