gulp-seajs-transport-kevin
v1.0.6
Published
transport seajs modules gulp plugin
Downloads
4
Readme
gulp-seajs-transport
transport seajs module gulp plugin
用于对seajs模块进行transport化
Note
本插件不需要每个模块拥有package.json
Install
$ npm install --save-dev gulp-seajs-transport-kevin
Usage
var transport = require("gulp-seajs-transport-kevin");
var gulp = require("gulp");
gulp.task("default",function(){
gulp.src("./testfiles/**/*.js")
.pipe(transport())
.pipe(gulp.dest("./dist"));
})
如果要生成一个相对路径的模块
var transport = require("gulp-seajs-transport-kevin");
var gulp = require("gulp");
gulp.task("default",function(){
gulp.src("./testfiles/abc/def/test.js",{base:"./testfiles/abc"})
.pipe(transport()) //此时seajs模块id为=>def/test
.pipe(gulp.dest("./dist"));
})
API (0.1.0版本废弃,使用gulp自带的options设置base来)
options.base
Type: String
Default: file.base
transport时可以指定一个基准路径,使生成的模块ID都是相对于这个基准路径的
如某个文件为/root/ab/c/d.js
设置base为/root/ab
最后的结果为=>c/d
Change List
1.0.0 => 去掉本插件的base路径配置,使用gulp的file自带的
Licence
MIT