Skip to content

Instantly share code, notes, and snippets.

@painhardcore
Created January 31, 2016 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save painhardcore/170a77866218bfa97bde to your computer and use it in GitHub Desktop.
Save painhardcore/170a77866218bfa97bde to your computer and use it in GitHub Desktop.
config
var gulp = require('gulp');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var coffee = require('gulp-coffee');
var templateCache = require('gulp-angular-templatecache');
var paths = {
jsfolder:"../gott/src/gott/static/js",
cssfolder:"../gott/src/gott/static/css",
coffeescript: 'app/**/*.coffee',
styles: 'app/**/*.css',
templates: 'app/**/*.html',
packagescripts: ['node_modules/angular/angular.min.js',
'node_modules/angular-ui-router/release/angular-ui-router.min.js'
]
};
gulp.task('templates', function () {
gulp.src(paths.templates)
.pipe(templateCache('templates.js', {module: 'ttapp'}))
.pipe(gulp.dest(paths.jsfolder));
});
gulp.task('packagescripts', function () {
gulp.src(paths.packagescripts)
.pipe(concat('packagescripts.js'))
.pipe(gulp.dest(paths.jsfolder));
});
gulp.task('styles', function () {
gulp.src(paths.styles)
.pipe(concat('all.css'))
.pipe(gulp.dest(paths.cssfolder));
});
gulp.task('makecoffee', function() {
gulp.src(paths.coffeescript)
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(concat('app.js'))
.pipe(gulp.dest(paths.jsfolder));
});
gulp.task('staticindex', function() {
gulp.src('app.html')
.pipe(gulp.dest('../gott/src/gott/'));
});
gulp.task('watch', function () {
gulp.watch(paths.coffeescript, ['makecoffee']);
gulp.watch(paths.styles, ['styles']);
gulp.watch(paths.templates, ['templates']);
gulp.watch(paths.packagescripts, ['packagescripts']);
gulp.watch('app.html', ['staticindex']);
});
gulp.task('default', ['watch', 'makecoffee', 'styles', 'templates', 'packagescripts','staticindex']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment