Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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