1
Good morning. I am unable to concatenate the Angularjs files using the Gulp Concat module. I tried to change the directory file and it still doesn’t work. The problem is that I don’t see any error, just don’t concatenate. All tasks run well, only the one that is giving problem.
var gulp = require('gulp');
var clean = require('gulp-clean');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var bases = {
app: 'app/',
dist: 'dist/',
};
var paths = {
scripts: ['scripts/**/*.js', '!scripts/libs/**/*.js'],
libs: ['scripts/libs/angular/angular.min.js', 'scripts/libs/angular/angular-animate.js', 'scripts/libs/angular/angular-messages.min.js','scripts/libs/angular/angular-resource.min.js'],
styles: ['styles/**/*.css'],
html: ['index.html'],
images: ['images/**/*.png']
};
gulp.task('clean', function() {
return gulp.src(bases.dist)
.pipe(clean());
});
gulp.task('scripts', ['clean'], function() {
gulp.src(paths.scripts, {cwd: bases.app})
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(uglify())
.pipe(concat('app.min.js'))
.pipe(gulp.dest(bases.dist + 'scripts/'));
});
gulp.task('imagemin', ['clean'], function() {
gulp.src(paths.images, {cwd: bases.app})
.pipe(imagemin())
.pipe(gulp.dest(bases.dist + 'images/'));
});
gulp.task('copy', ['clean'], function() {
gulp.src(paths.html, {cwd: bases.app})
.pipe(gulp.dest(bases.dist));
gulp.src(paths.styles, {cwd: bases.app})
.pipe(gulp.dest(bases.dist + 'styles'));
gulp.src(paths.libs, {cwd: 'app/**'})
.pipe(gulp.dest(bases.dist));
});
gulp.task('watch', function() {
gulp.watch('app/**/*', ['scripts', 'copy']);
});
gulp.task('default', ['clean', 'scripts', 'imagemin', 'copy']);
Can someone give me a hand?
Where is located the app.min.js file?
– Israel Sousa