Closed dongtong closed 8 years ago
Hello, I am using riotify for compile my tags
in one js
file.
var gulp = require('gulp');
var browserify = require('browserify');
var riotify = require('riotify');
var source = require('vinyl-source-stream');
gulp.task('browserify', function () {
return browserify({
debug: true,
entries: ['./scripts/main.js'],
transform: [riotify]
}).bundle()
.pipe(source('main.bundle.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('default', ['browserify']);
this plugin use browserify
for generate js file and you have the feature require
for do call of components.
var riot = require('riot');
require('../tags/sample.tag');
riot.mount('sample');
I Like riotify
@dongtong Hi
I use gulp-concat
in my project.
gulp.task('riot', ()=> {
gulp.src('directories')
.pipe(riot())
.pipe(concat('index.js'))
.pipe(gulp.dest('dest'))
})
It is also good to use browserify as @afwilliams says.
Thanks
@e-jigsaw Yep, I used same solution as you pointed. BTW, Thanks a lot
Hi, I wanna know how to compile some directory's tags into one js.
Thanks a lot