server/gulpfile.js
2020-07-23 10:43:20 +00:00

35 lines
865 B
JavaScript

const gulp = require('gulp')
const cleanCSS = require('gulp-clean-css')
const terser = require('gulp-terser')
const developmentPath = './assets/development'
const productionPath = './assets/production'
function minifyStyles() {
return gulp.src(developmentPath + '/styles/*.css')
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest(productionPath + '/styles'))
}
function minifyScripts() {
return gulp.src(developmentPath + '/scripts/home.js')
.pipe(terser())
.pipe(gulp.dest(productionPath + '/scripts'))
}
function copyFavicon() {
return gulp.src(developmentPath + '/favicon.ico')
.pipe(gulp.dest(productionPath))
}
function copyImages() {
return gulp.src(developmentPath + '/imgs/*')
.pipe(gulp.dest(productionPath + '/imgs'))
}
exports.build = gulp.series(
copyImages,
copyFavicon,
minifyScripts,
minifyStyles
)