Answer the question
In order to leave comments, you need to log in
How to properly minify an AngularJs application?
There is an application written in angular, it is not written very well, as it usually happens, I decided to first bring it to a normal structure - move the controllers and everything that comes with them into separate folders, and manually inject dependencies through SomeController.$inject = ['foo', 'bar'];
After this mind-blowing fun, I decided compile this case into one file using gulp , here is my gulp file:
gulp.task('scripts', function() {
return gulp.src(['public/assets/**/*.js', '!public/assets/vendor/**/*.js'])
.pipe(cached('scripts'))
.pipe(jshint())
.pipe(header('(function () {'))
.pipe(footer('})();'))
.pipe(remember('scripts'))
.pipe(ngmin())
.pipe(concat('app.js'))
.pipe(gulp.dest('public/'));
Answer the question
In order to leave comments, you need to log in
it to the normal structure - move the controllers and everything attached to them into separate folders
// плохо
var app = angular.module('app', deps);
// ...
app.service('foo', FooService);
// хорошо
angular.module('app').service('foo', FooService);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question