gulp-angular-module-dependencies

0.1.4 • Public • Published

gulp-angular-module-dependencies

Install

$ npm i --save-dev gulp-angular-module-dependencies

Description

This module helps you to find all Angular.js modules declared in your project and automatically add them as dependencies to the main app module. Preserve all declared dependencies and the declaration order.

Usage

var gulp = require('gulp');
var moduleDependencies = require('gulp-angular-module-dependencies');
 
gulp.task('add-dependencies', function(){
    return gulp.src(['app.js', 'module.js'])
        .pipe(moduleDependencies('myApp'))
        .pipe(gulp.dest('./'));
})

The app.js

angular.module('myApp', ['ui-router']);
angular.module('myApp').controller(function(){/*...*/});

The module.js

angular.module('myApp.module', ['ngResources']);
angular.module('myApp.anotherModule', ['ngAnimate']);

Only app.js is modified into the following output:

angular.module('myApp',[
    'myApp.anotherModule',
    'myApp.module',
    'ui-router'
]);
angular.module('app').controller(function () {/*...*/ });

API

moduleDependencies([moduleName], [options])


moduleName string default: app

The module where add all dependencies found.


options object default: {} The options object with the following options:

options.angularObjectName string default: angular

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.4
    111
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.4
    111
  • 0.1.3
    2
  • 0.1.2
    2
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i gulp-angular-module-dependencies

Weekly Downloads

115

Version

0.1.4

License

ISC

Last publish

Collaborators

  • danielbertocci