0.2.5 • Published 9 years ago

gulp-define-vm-module v0.2.5

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

gulp-define-vm-module

NPM version Build status Code Climate Coverage Status Dependencies devDependencies

gulp-define-vm-module 此插件可以将browserify合并规则的源代码合成为CMD风格的模块化文件.

define('moduleName', function(require, exports, module){
var mod = (browserify script);
return mod['main_module_num'];
})

use Example

var defineVMModule = require('gulp-define-vm-module');
gulp.src('path/src/index.js')
            .pipe(defineVMModule({
                moduleName: moduleName
            }))
            .pipe(gulp.dest('dest'));

合并规则

path 下有 index.js a.js b.js index.js依赖a.js b.js

生成 dest/moduleName.js

如果有外部依赖则在js中使用window['require'](moduleName)引用 (跟子模块依赖区分) 生成代码会自动转成require(moduleName), 内部模块的require会被derequire重命名

License

This project is distributed under the MIT license.

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.9

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago