< example >
< p > This is { sample } < / p > this.sample = 'example' < / example >
import gulp from 'gulp' ;
import riot from 'gulp-riot' ;
gulp . task ( 'riot' , ( ) => {
gulp . src ( 'example.tag' )
. pipe ( riot ( ) )
. pipe ( gulp . dest ( 'dest' ) ) ;
} ) ;
% gulp riot % cat example.js riot.tag( ' example ' , ' <p>This is { sample }</p> ' , function(opts) { this.sample = ' example ' })
gulp . src ( 'example.tag' )
. pipe ( riot ( {
compact : true // <- this
} ) )
. pipe ( gulp . dest ( 'dest' ) ) ;
-
compact: Boolean -
Minify </p> <p> to </p><p>
-
-
whitespace: Boolean -
Escape \n to \\n
-
-
expr: Boolean -
Run expressions through parser defined with --type
-
-
type: String, coffeescript | typescript | cs | es6 | livescript | none -
JavaScript parser
-
-
template: String, jade -
Template parser -
See more: https://muut.com/riotjs/compiler.html
-
-
modular: Boolean -
For AMD and CommonJS option -
See more: http://riotjs.com/guide/compiler/#pre -compilation
-
-
parsers: Object -
Define custom parsers -
css: Function -
js: Function -
html: Function
-
% npm install gulp-riot
-
Node.js -
gulp
% npm run build
% npm test
-
jigsaw ( http://jgs.me , @e-jigsaw ) -
And contributors!