expressCart/gulpfile.js

44 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-01-07 04:55:48 +10:00
const gulp = require('gulp');
const cleanCSS = require('gulp-clean-css');
const minify = require('gulp-minify');
const rename = require('gulp-rename');
gulp.task('compressJS', () => {
2018-02-04 05:13:14 +10:00
return gulp.src(['public/javascripts/*.js', '!public/javascripts/*.min.js'])
2018-01-07 04:55:48 +10:00
.pipe(minify({
ext: {
src: '.js',
min: '.min.js'
}
}))
.pipe(gulp.dest('public/javascripts'));
});
2018-02-14 07:15:14 +10:00
gulp.task('compressCss', () => {
2018-01-07 04:55:48 +10:00
return gulp.src(['public/stylesheets/*.css',
2018-02-14 07:15:14 +10:00
'!public/stylesheets/*.min.css'
2018-01-07 04:55:48 +10:00
])
2019-07-12 18:06:34 +10:00
.pipe(cleanCSS({ compatibility: 'ie8' }))
2018-01-07 04:55:48 +10:00
.pipe(rename({
dirname: 'public/stylesheets',
extname: '.min.css'
}))
.pipe(gulp.dest('./'));
});
2018-02-14 07:15:14 +10:00
gulp.task('compressThemeCss', () => {
return gulp.src(['views/themes/**/*.css',
'!views/themes/**/*.min.css'
])
2019-07-12 18:06:34 +10:00
.pipe(cleanCSS({ compatibility: 'ie8' }))
2018-02-14 07:15:14 +10:00
.pipe(rename({
extname: '.min.css'
}))
.pipe(gulp.dest('views/themes/'));
});
2018-01-07 04:55:48 +10:00
// run the tasks
2018-10-05 21:57:41 +10:00
gulp.task('deploy', gulp.series('compressJS', 'compressCss', 'compressThemeCss', (done) => {
done();
}));