Fixing gulp file
parent
3c9a86306a
commit
bdf0e8c59d
29
gulpfile.js
29
gulpfile.js
|
@ -1,21 +1,22 @@
|
|||
const { src, dest, series } = require('gulp');
|
||||
const gulp = require('gulp');
|
||||
const cleanCSS = require('gulp-clean-css');
|
||||
const minify = require('gulp-minify');
|
||||
const rename = require('gulp-rename');
|
||||
|
||||
gulp.task('compressJS', () => {
|
||||
return gulp.src(['public/javascripts/*.js', '!public/javascripts/*.min.js'])
|
||||
function compressJS(){
|
||||
return src(['public/javascripts/*.js', '!public/javascripts/*.min.js'])
|
||||
.pipe(minify({
|
||||
ext: {
|
||||
src: '.js',
|
||||
min: '.min.js'
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('public/javascripts'));
|
||||
});
|
||||
.pipe(dest('public/javascripts'));
|
||||
};
|
||||
|
||||
gulp.task('compressCss', () => {
|
||||
return gulp.src(['public/stylesheets/*.css',
|
||||
function compressCss(){
|
||||
return src(['public/stylesheets/*.css',
|
||||
'!public/stylesheets/*.min.css'
|
||||
])
|
||||
.pipe(cleanCSS({ compatibility: 'ie8' }))
|
||||
|
@ -23,21 +24,19 @@ gulp.task('compressCss', () => {
|
|||
dirname: 'public/stylesheets',
|
||||
extname: '.min.css'
|
||||
}))
|
||||
.pipe(gulp.dest('./'));
|
||||
});
|
||||
.pipe(dest('./'));
|
||||
};
|
||||
|
||||
gulp.task('compressThemeCss', () => {
|
||||
return gulp.src(['views/themes/**/*.css',
|
||||
function compressThemeCss(){
|
||||
return src(['views/themes/**/*.css',
|
||||
'!views/themes/**/*.min.css'
|
||||
])
|
||||
.pipe(cleanCSS({ compatibility: 'ie8' }))
|
||||
.pipe(rename({
|
||||
extname: '.min.css'
|
||||
}))
|
||||
.pipe(gulp.dest('views/themes/'));
|
||||
});
|
||||
.pipe(dest('views/themes/'));
|
||||
};
|
||||
|
||||
// run the tasks
|
||||
gulp.task('deploy', gulp.series('compressJS', 'compressCss', 'compressThemeCss', (done) => {
|
||||
done();
|
||||
}));
|
||||
gulp.task('default', series(compressJS, compressCss, compressThemeCss));
|
||||
|
|
Loading…
Reference in New Issue