Trying to concat/uglify my angular
app using gulp
for the last few hours, i have stripped down whole process to simple concat, and even removed angular file from concat process to a separate <script>
request in header - and still, I receive the same error:
Uncaught TypeError: angular.module(...).factory(...) is not a function
Without concat everything is fine.
My gulp task:
gulp.task('JS', function() {
gulp.src(['!_dependencies/angular.min.js', '_dependencies/jquery.min.js', '_dependencies/moment.min.js', 'Alpha/_lilhelpers.js', 'Alpha/routes.js' , '!trainerreg.js', '**/*.js'], {cwd: './public/scripts'})
.pipe(concat('concat.js'))
.pipe(gulp.dest('./public/min'));
});
It seems that Error basicaly happends as soon as .factory
appears in code.
Here is the line on which it currently stops with error - it is a minified code, yet i am not minifiying it, im just concating files right now including angular-animate.min
from which this line of code (1st one in fact).
And if I remove angular-animate
it will just throw error on another factory that will be on the way.
(function(N,f,W){'use strict';f.module("ngAnimate",["ng"]).directive("ngAnimateChildren",function(){return function(X,r,g){g=g.ngAnimateChildren;f.isString(g)&&0===g.length?r.data("$$ngAnimateChildren",!0):X.$watch(g,function(f){r.data("$$ngAnimateChildren",!!f)})}}).factory("$$animateReflow",["$$rAF","$document",function(f,r){var g=r[0].body;return function(r){return f(function(){r(g.offsetWidth)})}}]).config...
UPDATE: Oh, I was mistaken, it's NOT breaking as soon as .factory met; it breaks as soon as it meets .factory in minified part of concated file...
Will be happy to hear any solutions/assumptions!