grunt-webcomponent-master v0.0.2
grunt-templator
grunt-webcomponent-master
Getting Started
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-templator --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-templator');
The "templator" task
Overview
In your project's Gruntfile, add a section named templator
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
templator: {
options: {
markupFile: '/template_markup.html',
styleFile: '/template_style.css',
resultFile: '/template_result.html'
},
your_target: {
options: {
markupFile: '/template_markup.html',
styleFile: '/template_style.css',
resultFile: '/template_result.html'
}
},
},
})
Options
options.markupFile
Type: String
A string value that is the relative path to the template markup file
options.styleFile
Type: String
A string value that is the relative path to the template style file
options.resultFile
Type: String
A string value that is the relative path to the template result file which is a combination of the two mentioned above
Usage Examples
Default Options
In this example, the default options are used to do generate the Web component template from the markup and style files. So if the markup file has the content :
<div> I am template markup </div>
,and the style file has the content :
body { background: #0000ff; } , - the generated result would be :
<template>
<style> body{ background: #0000ff; } </style> <div> I am template markup </div> </template>
Release History
(Nothing yet)
License
Copyright (c) 2015 Eugene Klymenko. Licensed under the MIT license.