summaryrefslogtreecommitdiffhomepage
path: root/gulpfile.js
diff options
context:
space:
mode:
authorCamil Staps2018-09-02 23:30:09 +0200
committerCamil Staps2018-09-02 23:30:09 +0200
commit86a9432672f762882f7e2a39a98b0d95fa22023c (patch)
tree45a7de0f70fb162c4cd9db56fda202fd8467b477 /gulpfile.js
parentDrop bower (diff)
Update dependencies for vulnerabilities
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js42
1 files changed, 25 insertions, 17 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 09dd8f8..79e80ed 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -3,25 +3,23 @@ var gulp = require('gulp'),
pug = require('gulp-pug'),
minifyhtml = require('gulp-minify-html'),
notify = require('gulp-notify'),
- sass = require('gulp-ruby-sass');
+ sass = require('gulp-sass');
var config = {
sassPath: './resources/sass',
pugPath: './resources/pug'
}
-gulp.task('watch', function() {
+function watch() {
gulp.watch(config.sassPath + '/**/*.scss', ['css']);
gulp.watch(config.pugPath + '/**/*.pug', ['pug']);
-});
-
-gulp.task('default', ['css', 'pug', 'img', 'fonts']);
+}
-gulp.task('css', function() {
+function css() {
return gulp.src(config.sassPath + '/style.scss')
.pipe(sass({
- style: 'compressed',
- loadPath: [
+ outputStyle: 'compressed',
+ includePaths: [
'./resources/sass',
'./node_modules/bootstrap-sass/assets/stylesheets'
]
@@ -31,27 +29,37 @@ gulp.task('css', function() {
}))
)
.pipe(gulp.dest('./build/assets/css'));
-});
+}
-gulp.task('pug', function() {
- var src = './resources/pug/finals/**/*.pug',
+function html() {
+ var src = config.pugPath + '/finals/**/*.pug',
dst = './build';
return gulp.src(src)
.pipe(changed(dst, {extension: 'html'}))
.pipe(pug({
- basedir: './resources/pug/include'
+ basedir: config.pugPath + '/include'
}))
.pipe(minifyhtml())
.pipe(gulp.dest(dst));
-});
+}
-gulp.task('img', function() {
+function img() {
return gulp.src('./resources/img/*')
.pipe(gulp.dest('./build/assets/img'));
-});
+}
-gulp.task('fonts', function() {
+function fonts() {
return gulp.src('./resources/fonts/*')
.pipe(gulp.dest('./build/assets/fonts'));
-});
+}
+
+exports.css = css;
+exports.html = html;
+exports.img = img;
+exports.fonts = fonts;
+exports.watch = watch;
+
+var build = gulp.parallel(css, html, img, fonts);
+gulp.task('build', build);
+gulp.task('default', build);