gulp-riot-only-compiler-template

0.0.2 • Public • Published

项目起因

riot3.0后可以通过extend riot.Tag来生成新的组件,新的构造函数中有get tmpl()来提供新组件所需的模板,但这个模板必须符合riot.tag的一系列规范,额外增加理解成本。 使用gulp-riot-only-compiler-template可以将tag文件转换成符合riot.tag标准的模板

使用方式

npm install --save-dev gulp-riot-only-compiler-template
var gulp = require('gulp');
var riotTmpl = require('gulp-riot-only-compiler-template');
gulp.task('riotTmpl', function(){
    gulp.src('./*.tag')
    .pipe(riotTmpl({
        //opts: opts,
        //extname: 'tag'
    }))
    .pipe(gulp.dest('./output'))
});

参数说明

  • optsriot.compiler所需参数
  • extname为转换后文件的扩展名

Package Sidebar

Install

npm i gulp-riot-only-compiler-template

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • fanshaoyong