build: modularize the gulp file to be easier to maintain (#14259)
This is a precursor to bringing in some of the gulp tasks from angular.io, which could lead to the gulpfile becoming unwieldy.
This commit is contained in:

committed by
Igor Minar

parent
a9096437fd
commit
0ba5bebf61
16
tools/gulp-tasks/check-cycle.js
Normal file
16
tools/gulp-tasks/check-cycle.js
Normal file
@ -0,0 +1,16 @@
|
||||
module.exports = (gulp) => (done) => {
|
||||
const madge = require('madge');
|
||||
|
||||
const dependencyObject = madge(['dist/all/'], {
|
||||
format: 'cjs',
|
||||
extensions: ['.js'],
|
||||
onParseFile: function(data) { data.src = data.src.replace(/\/\* circular \*\//g, '//'); }
|
||||
});
|
||||
const circularDependencies = dependencyObject.circular().getArray();
|
||||
if (circularDependencies.length > 0) {
|
||||
console.log('Found circular dependencies!');
|
||||
console.log(circularDependencies);
|
||||
process.exit(1);
|
||||
}
|
||||
done();
|
||||
};
|
Reference in New Issue
Block a user