Css and JS files doesn't minify and concatenate when use gulp-jade and gulp-useref
Date : March 29 2020, 07:55 AM
it should still fix some issue You're piping Jade templates into useref(). However gulp-useref has no clue how to parse Jade. It only knows HTML. That means you need to compile your Jade templates to HTML before you pipe them to useref(). Doing it in a separate task jade2html like you're trying to doesn't really work (at least not the way you're doing it). Besides you only really need one task to begin with: gulp.task('useref', function() {
return gulp.src('app/*.jade')
.pipe(jade({pretty: true}))
.pipe(useref())
.pipe(gulpIf('*.js', uglify()))
.pipe(gulpIf('*.css', cssnano()))
.pipe(gulp.dest('dist'))
})
|
How to rename the original files of scripts in index.html using gulp?
Date : March 29 2020, 07:55 AM
This might help you EDIT: The issue is that you return only one of the two tasks. The first task is simply ignored by gulp, since it is not returned. A simple solutions: Split it into two tasks, and reference the one from the other, like in this SO answer. Old Answer .pipe(rename(function (path) {
path.basename += vsn;
path.extname = ".js"
}))
|
Gulp minify and don't copy original files
Date : March 29 2020, 07:55 AM
may help you . I want to minify some JS files with Gulp, but can't seem to get control over the process. I want only the minified version in the destination, and am currently getting copies of the originals as well. , Set the noSource config like the following .pipe(minify({noSource: true})
|
Gulp 4 - CSS minify and rename
Date : March 29 2020, 07:55 AM
Does that help I minify CSS generated from SASS. After switch to Gulp 4 have problem rename and minify CSS. , In these two lines of your code: gulp.task("css:minify", gulp.series(["css:compile"]), function () {
gulp.task("css", gulp.series(["css:minify"]));
gulp.task("css:minify", gulp.series("css:compile"), function () {
gulp.task("css", gulp.series("css:minify"));
|
CSS minify and rename with gulp
Tag : css , By : user184975
Date : March 29 2020, 07:55 AM
|