Answer the question
In order to leave comments, you need to log in
How to speed up the assembly and minification of js scripts?
There are four js files: two of them are third-party, two are written by hand. The minification speed of the final file is always the same - 20 seconds, how can I reduce it?
Here is the required part of the code in the hapfile:
var gulp = require("gulp"),
concat = require("gulp-concat"),
uglify = require("gulp-uglifyjs");
gulp.task("auto-scripts", function() {
return gulp.src([
"app/public/vendors/jquery/jquery.min.js",
"app/public/vendors/ckeditor/ckeditor.js"
])
.pipe(concat("auto-scripts.js"))
.pipe(gulp.dest("app/public/meta/js"))
})
gulp.task("hand-scripts", function() {
return gulp.src([
"app/public/js/application.js",
"app/public/meta/js/script.js"
])
.pipe(concat("hand-scripts.js"))
.pipe(gulp.dest("app/public/meta/js"))
});
gulp.task("scripts", ["auto-scripts", "hand-scripts"], function() {
return gulp.src([
"app/public/meta/js/auto-scripts.js",
"app/public/meta/js/hand-scripts.js"
])
.pipe(concat("scripts.min.js"))
.pipe(uglify())
.pipe(gulp.dest("app/public/meta/js"))
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question