Good morning. I am not able to concatenate the AngularJS files using the gulp concat module. I have already tried to change the directory file and it still does not work. The problem is that no error appears to me, it simply does not concatenate. All tasks run well, only the one that is giving trouble.
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 anyone give me a hand?