grunt-webcomponent-master
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');
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'
}
},
},
})
Type: String
A string value that is the relative path to the template markup file
Type: String
A string value that is the relative path to the template style file
Type: String
A string value that is the relative path to the template result file which is a combination of the two mentioned above
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>
(Nothing yet)
Copyright (c) 2015 Eugene Klymenko. Licensed under the MIT license.