Skip to content

Commit

Permalink
Move static new stuff task to gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
crookedneighbor committed Sep 4, 2015
1 parent cfae45a commit bc9c12f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
13 changes: 2 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ module.exports = function(grunt) {

// Register tasks.
grunt.registerTask('compile:sprites', ['clean:sprite', 'sprite', 'imagemin', 'cssmin']);
grunt.registerTask('build:prod', ['loadManifestFiles', 'clean:build', 'browserify', 'uglify', 'stylus', 'cssmin', 'copy:build', 'hashres','prepare:staticNewStuff']);
grunt.registerTask('build:dev', ['browserify', 'stylus', 'prepare:staticNewStuff']);
grunt.registerTask('build:prod', ['loadManifestFiles', 'clean:build', 'browserify', 'uglify', 'stylus', 'cssmin', 'copy:build', 'hashres']);
grunt.registerTask('build:dev', ['browserify', 'stylus']);
grunt.registerTask('build:test', ['test:prepare:translations', 'build:dev']);

grunt.registerTask('run:dev', [ 'build:dev', 'concurrent' ]);
Expand All @@ -239,15 +239,6 @@ module.exports = function(grunt) {
"window.env.translations = " + JSON.stringify(i18n.translations['en']) + ';');
});

grunt.registerTask('prepare:staticNewStuff', function() {
var jade = require('jade'),
fs = require('fs');
fs.writeFileSync(
'./website/public/new-stuff.html',
jade.compileFile('./website/views/shared/new-stuff.jade')()
);
});

// Load tasks
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');
Expand Down
4 changes: 2 additions & 2 deletions tasks/gulp-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ gulp.task('build', () => {
}
});

gulp.task('build:dev', (done) => {
gulp.task('build:dev', ['prepare:staticNewStuff'], (done) => {
gulp.start('grunt-build:dev', done);
});

gulp.task('build:prod', (done) => {
gulp.task('build:prod', ['prepare:staticNewStuff'], (done) => {
gulp.start('grunt-build:prod', done);
});
10 changes: 10 additions & 0 deletions tasks/gulp-newstuff.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp';
import jade from 'jade';
import {writeFileSync} from 'fs';

gulp.task('prepare:staticNewStuff', () => {
writeFileSync(
'./website/public/new-stuff.html',
jade.compileFile('./website/views/shared/new-stuff.jade')()
);
});

0 comments on commit bc9c12f

Please sign in to comment.