Answer the question
In order to leave comments, you need to log in
Why doesn't Gulp upload minified files?
Good afternoon :)
I'm trying to minify a js file.
Everything seems to be successful. But there is no file :(
gulpfile.js
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var pump = require('pump');
gulp.task('compress', function (cb) {
pump([
gulp.src('/app/js/app.js'),
uglify(),<code></code>
gulp.dest('dist')
],
cb
);
});
D:\Program\OpenServer\OpenServer\domains\gulpjs.local>gulp compress
[16:04:48] Using gulpfile D:\Program\OpenServer\OpenServer\domains\gulpjs.local\gulpfile.js
[16:04:48] Starting 'compress'...
[16:04:48] Finished 'compress' after 28 ms
D:\Program\OpenServer\OpenServer\domains\gulpjs.local>
Answer the question
In order to leave comments, you need to log in
Well, you have an app.js file and it is minified.
Here is a snippet from my code, it works as it should:
gulp.task('min', () => {
gulp.src(variables.public.js + '/*.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(variables.public.js));
gulp.src(variables.public.css + '/*.css')
.pipe(combineMq({
beautify: false
}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(variables.public.css));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question