You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

rollup-plugin-vue-template-compiler

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-vue-template-compiler

Rollup plugin to compile Vue.js 2.0 templates.

1.0.3
latest
Source
npm
Version published
Weekly downloads
26
-61.76%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-vue-template-compiler

Rollup plugin to compile Vue.js 2.0 templates.

npm i rollup-plugin-vue-template-compiler --save-dev

Sample rollup config

import vueTemplateCompiler from 'rollup-plugin-vue-template-compiler';
import buble from 'rollup-plugin-buble';

export default {
  entry: 'index.js',
  dest: 'dist/app.js',
  format: 'umd',
  plugins: [
    vueTemplateCompiler({
      include: '**/*.html'
    }),
    buble()
  ]
};

Usage

import template from './template.html'

template will be an object

{
  render: Function,
  staticRenderFns: Array<Function>
}

Set render and staticRenderFns properties on a component e.g:

// manually
import template from './template.html'

export const myComponent = {
  render: template.render,
  staticRenderFns: template.staticRenderFns,
  mounted () {}
}



// mixin
import template from './template.html'

export const myComponent = {
  mixins: [template],
  mounted () {}
}



// stage2 object spread
import template from './template.html'

export const myComponent = {
  ...template,
  mounted () {}
}

FAQs

Package last updated on 16 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts