diff options
-rw-r--r-- | gulpfile.js | 42 | ||||
-rw-r--r-- | package.json | 4 |
2 files changed, 27 insertions, 19 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); diff --git a/package.json b/package.json index 34f307a..f187340 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,12 @@ "version": "0.1.0", "devDependencies": { "bootstrap-sass": "~3.3.2", - "gulp": "^3.9.1", + "gulp": "^4.0.0", "gulp-changed": "~3.2.0", "gulp-minify-html": "^1.0.6", "gulp-notify": "^2.2.0", "gulp-pug": "~3.3.0", - "gulp-ruby-sass": "^0.7.1", + "gulp-sass": "^4.0.1", "markdown-js": "0.0.4" }, "dependencies": { |