luna/Gulpfile.js

54 lines
1.0 KiB
JavaScript

// Probably a bad thing, but all pages are **hard-coded** into
// the Gulpfile, so they can be copied. This is because there
// won't be any posts on the website, so this won't have to be
// updated any time soon.
const gulp = require('gulp')
const cleanCSS = require('gulp-clean-css')
const del = require('del')
const postcss = require('gulp-postcss')
// CSS
function css() {
return gulp.src('src/css/styles.css')
.pipe(postcss([
require('tailwindcss'),
require('autoprefixer')
]))
.pipe(cleanCSS())
.pipe(gulp.dest('dist/assets/css'))
}
// Images
// TODO: Optimize images with a Gulp plugin
function images() {
return gulp.src('src/img/**/*.{png,jpg,jpeg}')
.pipe(gulp.dest('dist/assets/img'))
}
// Pages
function home() {
return gulp.src('src/index.html')
.pipe(gulp.dest('dist'))
}
// Clean
function clean() {
return del([
'dist'
])
}
exports.css = css
exports.images = images
exports.home = home
exports.clean = clean
exports.default = gulp.series(home, css, images)