Skip to content

Commit

Permalink
fix: _つきのscssファイルだとスタイルガイドが生成されない不具合の修正
Browse files Browse the repository at this point in the history
  • Loading branch information
sable-virt committed Apr 19, 2016
1 parent 197be97 commit d959ec6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
4 changes: 0 additions & 4 deletions gulp/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ let cssMqpacker = require('css-mqpacker');

gulp.task('style', () => {
config.style = config.style || {};
let guideOptions = merge({
out: './guide/'
}, config.styleguide);
let sourcemaps = config.style.sourcemaps || './maps';

return gulp.src(config.path.style.src)
.pipe($.plumber({errorHandler: $.notify.onError('<%= error.message %>')}))
.pipe($.frontnote(guideOptions))
.pipe($.sassLint())
.pipe($.sassLint.format())
.pipe($.sassLint.failOnError())
Expand Down
19 changes: 19 additions & 0 deletions gulp/styleguide.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';
/**
* スタイルガイドタスク
* スタイルガイドをfrontnoteで生成する
*/
let gulp = require('gulp');
let _ = require('lodash');
let config = require('./config');
let $ = require('./plugins');

gulp.task('styleguide', () => {
config.style = config.style || {};
let guideOptions = _.merge({
out: './guide/'
}, config.styleguide);
return gulp.src(config.path.style.watch)
.pipe($.plumber({errorHandler: $.notify.onError('<%= error.message %>')}))
.pipe($.frontnote(guideOptions));
});
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gulp.task('watch', () => {
gulp.watch(config.path.ejs.watch, ['ejs']);
gulp.watch(config.path.html.src, ['html']);
gulp.watch(config.path.style.watch, ['style']);
gulp.watch(config.path.sprite.watch, ['sprite','style', 'copy']);
gulp.watch(config.path.sprite.watch, ['sprite','style', 'copy','styleguide']);

var copyWatches = [];
// 複製タスクはループで回して監視対象とする
Expand All @@ -30,7 +30,7 @@ gulp.task('watch', () => {
* ビルドタスク
*/
gulp.task('build', ['clean'], (callback) => {
return runSequence('sprite', ['ejs', 'script', 'style', 'copy'], callback);
return runSequence('sprite', ['ejs', 'script', 'style', 'copy','styleguide'], callback);
});

/**
Expand Down

0 comments on commit d959ec6

Please sign in to comment.