Skip to content

Commit

Permalink
Update gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Dec 6, 2015
1 parent 2c443fb commit 44e832b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
sudo: false

node_js:
- "0.12"
- "4"

cache:
apt: true
Expand Down
14 changes: 1 addition & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var cssnano = require('cssnano');

var htmlMinifierOptions = {
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
removeOptionalTags: true,
minifyJS: true,
minifyCSS: true
};

var dirs = {
public: 'public',
screenshots: 'public/build/screenshots'
Expand All @@ -27,18 +16,17 @@ gulp.task('useref', function(){

return gulp.src('public/**/*.html')
.pipe(assets)
.pipe($.uniqueFiles())
.pipe($.if('*.css', $.postcss([
cssnano()
])))
.pipe($.if('*.css', $.minifyCss()))
.pipe($.if('*.js', $.uglify()))
.pipe($.rev())
.pipe(assets.restore())
.pipe($.useref())
.pipe($.revReplace({
prefix: '/'
}))
.pipe($.if('*.html', $.htmlMinifier(htmlMinifierOptions)))
.pipe(gulp.dest('public'));
});

Expand Down
51 changes: 25 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,39 @@
"version": "3.1.1"
},
"scripts": {
"build": "hexo generate && gulp"
"build": "hexo generate && gulp",
"deploy": "hexo deploy"
},
"dependencies": {
"cheerio": "^0.18.0",
"cheerio": "^0.19.0",
"hexo": "^3.1.1",
"hexo-deployer-git": "0.0.4",
"hexo-generator-archive": "^0.1.3",
"hexo-generator-feed": "^1.0.0",
"hexo-generator-sitemap": "^1.0.0",
"hexo-generator-feed": "^1.0.3",
"hexo-generator-sitemap": "^1.0.1",
"hexo-renderer-jade": "^0.1.0",
"hexo-renderer-marked": "^0.2.3",
"hexo-renderer-stylus": "^0.2.0",
"hexo-server": "^0.1.1",
"lodash": "^3.0.0",
"lunr": "^0.5.7"
"hexo-renderer-marked": "^0.2.6",
"hexo-renderer-stylus": "^0.3.0",
"hexo-server": "^0.1.2",
"lodash": "^3.10.1",
"lunr": "^0.6.0"
},
"devDependencies": {
"cssnano": "^2.1.0",
"gulp": "^3.8.11",
"gulp-html-minifier": "^0.1.6",
"gulp-if": "^1.2.5",
"gulp-image-resize": "^0.6.0",
"gulp-load-plugins": "^0.8.0",
"gulp-minify-css": "^0.4.6",
"gulp-minify-html": "^1.0.0",
"gulp-postcss": "^4.0.3",
"gulp-rename": "^1.2.0",
"gulp-rev": "^3.0.1",
"gulp-rev-collector": "^0.1.4",
"gulp-rev-replace": "^0.4.0",
"gulp-uglify": "^1.1.0",
"gulp-useref": "^1.1.1"
"cssnano": "^3.3.2",
"gulp": "^3.9.0",
"gulp-if": "^2.0.0",
"gulp-image-resize": "^0.7.1",
"gulp-load-plugins": "^1.1.0",
"gulp-postcss": "^6.0.1",
"gulp-rename": "^1.2.2",
"gulp-rev": "^6.0.1",
"gulp-rev-collector": "^1.0.2",
"gulp-rev-replace": "^0.4.2",
"gulp-uglify": "^1.5.1",
"gulp-unique-files": "^0.1.2",
"gulp-useref": "^2.1.0"
},
"optionalDependencies": {
"hexo-browsersync": "^0.1.0"
"hexo-browsersync": "^0.2.0"
}
}
}

0 comments on commit 44e832b

Please sign in to comment.