gulp-defmod
v0.2.4
Published
convert nodejs package for front-end
Downloads
2
Readme
Information
Usage
var defmod = require('gulp-defmod');
var concat = require('gulp-concat');
gulp.task('scripts', function() {
return gulp.src('package/*.js')
.pipe(defmod({
dir:'package',
moduler:true
}))
.pipe(concat('dist.js'))
.pipe(gulp.dest('.'));
});
This will wrap contents of each files with module defination like:
define('module1', function(require, module, exports) {
// original file contents here
});
and also, replace all relative path exists in `require'.
Options
{
moduler:{bool|string}, whether use the default moduler loader/defination,
if true, will be the first file, string type
determin the file name to output,
dir:{string}, package directory, use last directory as package name
nopkg:(bool), don't add package name as prefix of module defination,
onedir:(bool), output file to one directory,
sep: if use onedir, the replacement of directory seperator
}
LICENSE
MIT.