gulp-module-name-amd
v2.0.1
Published
use the specified name as the amd module name if none
Downloads
2
Maintainers
Readme
gulp-module-name-amd
give AMD module a module name if none
Based on https://github.com/elvinzhu/gulp-name-amd
Install
$ npm install --save-dev gulp-module-name-amd
Usage
AMD module
/***
* views/index.js
**/
define(['base'], function( Baseview ){
"use strict";
......
})
run plugin
/***
* in gulpfile.js
**/
var nameAmd = require('gulp-module-name-amd');
...
gulp.src( './views/*.js' ) )
.pipe( nameAmd( ) )
.pipe( gulp.dest( './buld/views' ));
result
/***
* build/views/index.js
**/
define('index', ['base'], function( Baseview ){
"use strict";
......
})