This is based on gulp-angular-filesort. I extracted the module dependency code because I need to find a way to dynamically generate a root angular module that depends on a list of angular modules as Bower packages.
var fs = ;var ngDeps = ;var deps = ;console;
If the content of
./someNgModle.js is as following:
This will output:
dependencies: 'one' 'useThis'modules:'test': 'one''another':
If multiple declarations of the same module is encountered, (according to Angular Doc), the later declaration will overwrite any existing module that is declared with the same module name.
For example, the following content:
dependencies: 'another'modules:'test': 'another'
2.0.0 - use Babel parser; handle rest and spread properties
1.0.1 - update Esprima; handle JSX syntax
0.1.1 - fixing repo url in
package.json and removing unnecessary dependency.
0.1.0 - simplified output format; added detection for angular.js itself.