From db9bbebd34fce8823f306e8933db11313255e2f5 Mon Sep 17 00:00:00 2001 From: Patrick Sullivan Date: Mon, 8 Jan 2018 15:57:21 -0800 Subject: [PATCH] gulp-sass needed for production install no documentation for production install so hugo-bin is not needed Fixes #132 --- gulpfile.js | 4 +++- package.json | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 8b8da7f..8c05907 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,7 +5,8 @@ const gulp = require('gulp'), cleanCSS = require('gulp-clean-css'), rename = require('gulp-rename'), exec = require('child_process').execFile, - hugo = require('hugo-bin') + optional = require('optional'), + hugo = optional('hugo-bin') gulp.task('sass', function() { gulp.src('src/**/*.scss') @@ -54,3 +55,4 @@ gulp.task('minify-css', () => { gulp.task('default', ['sass','watch','hugo-server']); gulp.task('build', ['sass','minify-css','hugo-build']); +gulp.task('postinstall', ['sass','minify-css']); diff --git a/package.json b/package.json index af380ed..307104e 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "start": "node node_modules/gulp/bin/gulp.js", "build": "node node_modules/gulp/bin/gulp.js build", "test": "echo \"Error: no test specified\" && exit 1", - "postinstall": "gulp build" + "postinstall": "gulp postinstall" }, "repository": { "type": "git", @@ -24,12 +24,13 @@ "gulp-clean-css": "3.9.0", "gulp-connect": "5.0.0", "gulp-plumber": "1.1.0", - "gulp-rename": "1.2.2" + "gulp-rename": "1.2.2", + "gulp-sass": "^3.1.0", + "optional": "^0.1.4" }, "devDependencies": { "browserify": "^14.1.0", "chai": "^4.1.2", - "gulp-sass": "^3.1.0", "http-server": "^0.9.0", "gulp-less": "3.3.2", "gulp-plumber": "1.1.0",