Merge pull request #1195 from kalenjohnson/gulp

Added editor-style build to dev and build tasks
This commit is contained in:
Ben Word
2014-11-11 11:52:13 -06:00
2 changed files with 15 additions and 3 deletions

View File

@@ -18,6 +18,7 @@ var paths = {
'assets/src/js/**/*' 'assets/src/js/**/*'
], ],
less: 'assets/src/less/main.less', less: 'assets/src/less/main.less',
editorStyle: 'assets/src/less/editor-style.less',
bower: mainBowerFiles() bower: mainBowerFiles()
}; };
@@ -47,6 +48,17 @@ gulp.task('less:build', function() {
.pipe(gulp.dest('assets/dist/css')); .pipe(gulp.dest('assets/dist/css'));
}); });
gulp.task('less:editorStyle', function() {
return gulp.src(paths.editorStyle)
.pipe($.plumber())
.pipe($.less()).on('error', function(err) {
console.warn(err.message);
})
.pipe($.autoprefixer('last 2 versions', 'ie 9', 'android 2.3', 'android 4', 'opera 12'))
.pipe($.rename('./editor-style.css'))
.pipe(gulp.dest('assets/dist/css'));
});
gulp.task('jshint', function() { gulp.task('jshint', function() {
return gulp.src(paths.jshint) return gulp.src(paths.jshint)
.pipe($.jshint()) .pipe($.jshint())
@@ -114,6 +126,6 @@ gulp.task('watch', function() {
}); });
}); });
gulp.task('default', ['less:dev', 'jshint', 'js:dev']); gulp.task('default', ['less:dev', 'less:editorStyle', 'jshint', 'js:dev']);
gulp.task('dev', ['default']); gulp.task('dev', ['default']);
gulp.task('build', ['less:build', 'js:build', 'copy:fonts', 'copy:jquery', 'copy:modernizr', 'images', 'version']); gulp.task('build', ['less:build', 'less:editorStyle', 'js:build', 'copy:fonts', 'copy:jquery', 'copy:modernizr', 'images', 'version']);

View File

@@ -28,7 +28,7 @@ function roots_setup() {
add_theme_support('html5', array('caption', 'comment-form', 'comment-list')); add_theme_support('html5', array('caption', 'comment-form', 'comment-list'));
// Tell the TinyMCE editor to use a custom stylesheet // Tell the TinyMCE editor to use a custom stylesheet
add_editor_style('/assets/css/editor-style.css'); add_editor_style('/assets/dist/css/editor-style.css');
} }
add_action('after_setup_theme', 'roots_setup'); add_action('after_setup_theme', 'roots_setup');