gnm

gulp-ng-modules

Will search for the angular.module definition and inject dependencies based on configuration

Showing:

Popularity

Downloads/wk

1

GitHub Stars

0

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

3

Size (min+gzip)

44.5KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Gulp Angular Module injection

NPM version Build Status Coverage Status

Angular.js module dependency injection.

How it works?

It inject into a main module file that requires all your modules as a dependency.

Supports

  • Adding a new module

  • Removing a module

  • 3rd party modules

  • Data entry:

    • example-1.js

          angular.module('myGlobalApp', []);
      
    • example-2.js

          (function() {
              'use strict';
      
              angular.module('myGlobalApp', ['myModule'])
          })()
      
    • example-3.js

          (function() {
              'use strict';
      
              angular.module('myGlobalApp', [
              'myModule'
              ])
          })()
      

How to install

npm install gulp-ng-modules --save-dev

Usage

var gulp = require('gulp');
var ngModules = require('gulp-ng-modules');

gulp.task('inject:modules', function() {
  return gulp.src(['./app.js'])
    .pipe(ngModules({name: 'myGlobalApp'}))
    .pipe(gulp.dest('./dist'))
})

API

ngModules(options)

Options:

name

Type: string required

The name of the module to create.

modules

Type: array optional

List of additional modules to include.

filter

Type: array optional

List of additional modules to exclude.

transform

Type: function optional

Create a custom output file

Example

Check out the example directory: gulpfile.js

This is how the generated gulp-ng-modules.js will look like after

(function () {
  'use strict';
  angular.module('myGlobalApp', ['another.module', 'ui.router']);
})();

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100