gulp-jsc
v1.0.7
Published
a gulp-plugin for seajs combo
Downloads
6
Readme
gulp-jsc
实现了什么功能?(What we can do?)
- 按目录合并seajs模块,相对路径,一次合并到处运行,支持
seajs 1.0|1.1|1.2|1.3|1.3+
- 预编译html模板为
./tmpl.js
模块 - 文件改变自动编译
给个栗子 Sample gulpfile.js
var gulp = require('gulp');
var fs = require('fs');
var path = require('path');
var gutil = require('gulp-util');
var jsc = require('gulp-jsc');
gulp.task('default', function () {
//默认运行listen和all俩个任务
gulp.run(['listen','all']);
gutil.log('begin watch ..');
});
gulp.task('all', function () {
// 文件合并,这里表示把js/module里面全部可以合并的seajs模块合并
gulp.src('../res/js/module/**').pipe(jsc());
});
gulp.task('listen', function () {
// 监听文件合并,当src里某个文件改变的时候,合并其所在目录
gulp.watch("../res/js/**/src/**", function (event) {
gulp.src(event.path).pipe(jsc());
});
});
License
gulp-jsc is available under the terms of the [MIT License].
##The end.