gulp-steel-wrap-amd
用途
对js文件进行amd包裹, 例如a.js代码如下:
module.exports = function() {
var that = {};
that.show = function(){};
return that;
}
执行steelWrapAmd包裹之后a.js结果如下:
steel.d('', [], function(require, exports, module){
module.exports = function() {
var that = {};
that.show = function(){};
return that;
}
});
steel.d()的第一个参数指a文件的路径,第二个参数指所依赖的文件的路径
用法
var steelWrapAmd = require('steelWrapAmd');
steelWrapAmd();
示例
var steelWrapAmd = require('steelWrapAmd');
gulp.src(['src/js/**/*.js', '!src/js/lib/**.*.js'])
.pipe(steelWrapAmd())
.pipe(gulp.dest('server_front/js/'));