Last active
January 30, 2021 16:00
-
-
Save klugjo/f4f2ee250d32103e9e22 to your computer and use it in GitHub Desktop.
Basic gulpfile.js for a static website (HTML copy and CSS concatenation)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add our dependencies | |
var gulp = require('gulp'), // Main Gulp module | |
concat = require('gulp-concat'); // Gulp File concatenation plugin | |
// Configuration | |
var configuration = { | |
paths: { | |
src: { | |
html: './src/*.html', | |
css: [ | |
'./src/css/bootstrap.min.css', | |
'./src/css/main.css' | |
] | |
}, | |
dist: './dist' | |
} | |
}; | |
// Gulp task to copy HTML files to output directory | |
gulp.task('html', function() { | |
gulp.src(configuration.paths.src.html) | |
.pipe(gulp.dest(configuration.paths.dist)); | |
}); | |
// Gulp task to concatenate our css files | |
gulp.task('css', function () { | |
gulp.src(configuration.paths.src.css) | |
.pipe(concat('site.css')) | |
.pipe(gulp.dest(configuration.paths.dist + '/css')) | |
}); | |
// Gulp default task | |
gulp.task('default', ['html', 'css']); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment