瀏覽代碼

Clean up build tasks

master
John O'Nolan 3 年之前
父節點
當前提交
b7a788f973
共有 2 個文件被更改,包括 5 次插入54 次删除
  1. +1
    -42
      gulpfile.js
  2. +4
    -12
      package.json

+ 1
- 42
gulpfile.js 查看文件

@@ -1,15 +1,10 @@
var gulp = require('gulp');

// gulp plugins and utils
var csscomb = require('gulp-csscomb');
var del = require('del');
var extReplace = require('gulp-ext-replace');
var gutil = require('gulp-util');
var livereload = require('gulp-livereload');
var nodemon = require('gulp-nodemon');
var postcss = require('gulp-postcss');
var replace = require('gulp-replace');
var svgmin = require('gulp-svgmin');
var sourcemaps = require('gulp-sourcemaps');

// postcss plugins
@@ -27,16 +22,9 @@ var swallowError = function swallowError(error) {

var nodemonServerInit = function () {
livereload.listen(1234);

return nodemon({
ignore: ['gulpfile.js', 'assets/', 'public/', 'cachefiles/', 'locales/']
}).on('restart', function () {
gulp.src('app.js')
.pipe(livereload());
});
};

gulp.task('build', ['css', 'icons'], function (/* cb */) {
gulp.task('build', ['css'], function (/* cb */) {
return nodemonServerInit();
});

@@ -57,37 +45,8 @@ gulp.task('css', function () {
.pipe(livereload());
});

gulp.task('comb', function () {
return gulp.src('assets/css/**/*.css')
.pipe(csscomb())
.pipe(gulp.dest('assets/css/.'));
});

gulp.task('clean:icons', function () {
return del(['public/icons', 'views/partials/icons/*.hbs']);
});

gulp.task('icons', ['clean:icons'], function () {
gulp.src('assets/icons/**/*.svg')
.pipe(replace(/#(?:[0-9a-f]{3}){1,2}/gi, 'currentColor'))
.pipe(svgmin({
plugins: [{
removeDimensions: true
}, {
removeTitle: true
}]
}))
.pipe(gulp.dest('public/icons'))
.pipe(extReplace('.hbs'))
.pipe(gulp.dest('views/partials/icons'))
.on('end', function () {
livereload.reload();
});
});

gulp.task('watch', function () {
gulp.watch('assets/css/**', ['css']);
gulp.watch('assets/icons/**/*.svg', ['icons']);
});

gulp.task('default', ['build'], function () {


+ 4
- 12
package.json 查看文件

@@ -2,9 +2,9 @@
"name": "casper",
"description": "The default personal blogging theme for Ghost. Beautiful, minimal and responsive.",
"demo": "https://demo.ghost.io",
"version": "1.3.6",
"version": "2.0.0",
"engines": {
"ghost": ">=0.9.0 <1.0.0"
"ghost": ">=1.0.0"
},
"license": "MIT",
"screenshots": {
@@ -20,7 +20,7 @@
"type": "theme",
"categories": [
"Minimal",
"Personal Blogs"
"Magazine"
]
},
"keywords": [
@@ -35,25 +35,17 @@
"contributors": "https://github.com/TryGhost/Casper/graphs/contributors",
"devDependencies": {
"autoprefixer": "6.3.6",
"connect-livereload": "0.5.4",
"cssnano": "3.7.1",
"del": "2.2.1",
"gulp": "3.9.1",
"gulp-csscomb": "3.0.7",
"gulp-ext-replace": "0.3.0",
"gulp-live-server": "0.0.30",
"gulp-livereload": "3.8.1",
"gulp-nodemon": "2.1.0",
"gulp-postcss": "6.1.1",
"gulp-replace": "0.5.4",
"gulp-sourcemaps": "1.6.0",
"gulp-svgmin": "1.2.2",
"gulp-util": "3.0.7",
"gulp-watch": "4.3.8",
"postcss-color-function": "2.0.1",
"postcss-custom-properties": "5.0.1",
"postcss-easy-import": "1.0.1",
"postcss-import": "8.1.2"
"postcss-easy-import": "1.0.1"
},
"config": {
"posts_per_page": 25


Loading…
取消
儲存