extract all icon names from imweb-tpl files(.html, .tpl)
npm install grunt-iconprocessor-imweb-tpl
outputDir
fonts
iconfont.eot
iconfont.svg
iconfont.woff
iconfont.ttf
iconfont.scss
`
Getting Started
This plugin requires Grunt ~0.4.5
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:
`shell
npm install grunt-iconprocessor-imweb-tpl --save-dev
`
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js
grunt.loadNpmTasks('grunt-iconprocessor-imweb-tpl');
`
The "iconprocessor_imweb_tpl" task
$3
In your project's Gruntfile, add a section named iconprocessor_imweb_tpl to the data object passed into grunt.initConfig().
`js
grunt.initConfig({
iconprocessor_imweb_tpl: {
options: {
// Task-specific options go here.
svgDir: 'svgs/',
outpurDir: 'output/',
styleFile: 'main.scss'
},
src: [
// html, tpl, vm files
]
},
});
`
$3
#### options.svgDir
Type: String
Default: 'svgs'
This option specific svgs folder. By default, it is 'svgs' in root folder.
This svgs folder will be checked. If it not exists then task will clone svgs from the iconfont
#### options.outputDir
Type: String
Default: No default
This option specific output folder. Grunt error happens if not config.
A string value that is used to store generated files.
#### options.styleFile
Type: String
Default: No default
This option specific your base sass file in output folder. Grunt error happens if not config.
A string value that is used to append the below code to the top of base sass file:
`sass
@import 'iconfont.scss';
`
$3
In this example, the options are used to specify local svg folder is 'svgs/'.
`js
grunt.initConfig({
iconprocessor_imweb_tpl: {
options: {
svgPath: 'common/svgs/',
outputDir: 'static/css/',
styleFile: 'main.scss'
},
files: {
src: ['src/\/\*.html']
},
},
});
``