Last active
August 29, 2015 14:23
-
-
Save carbonrobot/2b73582ec067bc7f7c1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = { | |
port: process.env.PORT || 3000, | |
mqUrl: 'amqp://owl.rmq.cloudamqp.com/nwudxprq', | |
assets: { | |
lib: { | |
js: [ | |
'client/assets/lib/jquery/dist/jquery.js', | |
'client/assets/lib/angular/angular.js', | |
'client/assets/lib/angular-resource/angular-resource.js', | |
'client/assets/lib/angular-animate/angular-animate.js', | |
'client/assets/lib/angular-ui-router/release/angular-ui-router.js', | |
'client/assets/lib/bootstrap/dist/js/bootstrap.js', | |
'client/assets/lib/lodash/lodash.js' | |
] | |
}, | |
css: [ | |
'client/assets/lib/bootstrap/dist/css/bootstrap.css', | |
'client/assets/lib/bootstrap/dist/css/bootstrap-theme.css', | |
'client/assets/css/*.css' | |
], | |
fonts: [ | |
'client/assets/lib/bootstrap/dist/fonts/*' | |
], | |
js: [ | |
'client/app/app.js', | |
'client/app/app.routes.js', | |
'client/app/*/*.js' | |
], | |
views: 'client/app/views/*.html', | |
img: 'client/assets/img/**/*', | |
tests: [ | |
'client/lib/angular-mocks/angular-mocks.js', | |
'client/app/tests/*.js' | |
] | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
concat = require('gulp-concat'), | |
del = require('del'), | |
nodemon = require('gulp-nodemon'), | |
uglify = require('gulp-uglify'), | |
sourcemaps = require('gulp-sourcemaps'), | |
templateCache = require('gulp-angular-templatecache'), | |
bower = require('bower'), | |
config = require('./config/config.js'); | |
// vendor scripts | |
gulp.task('vendor', function() { | |
return gulp.src(config.assets.lib.js) | |
.pipe(concat('vendor.min.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest('public/js')); | |
}); | |
// styles | |
gulp.task('styles', ['fonts'], function () { | |
return gulp.src(config.assets.css) | |
.pipe(concat('styles.css')) | |
.pipe(gulp.dest('public/css')); | |
}); | |
// fonts | |
gulp.task('fonts', function () { | |
return gulp.src(config.assets.fonts) | |
.pipe(gulp.dest('public/fonts')); | |
}); | |
// client scripts | |
gulp.task('scripts', function() { | |
return gulp.src(config.assets.js) | |
.pipe(sourcemaps.init()) | |
.pipe(concat('application.min.js')) | |
.pipe(uglify()) | |
.pipe(sourcemaps.write()) | |
.pipe(gulp.dest('public/js')); | |
}); | |
// partials | |
gulp.task('templates', function() { | |
return gulp.src(config.assets.views) | |
.pipe(templateCache({ module: 'buoyApp' })) | |
.pipe(gulp.dest('public/js')); | |
}); | |
// images | |
gulp.task('images', function() { | |
return gulp.src(config.assets.img) | |
.pipe(gulp.dest('public/img')); | |
}); | |
// build | |
gulp.task('build', ['clean', 'bower'], function(){ | |
return gulp.start('vendor', 'styles', 'templates', 'scripts', 'images'); | |
}); | |
// watch | |
gulp.task('watch', function() { | |
gulp.watch('client/assets/css/*.css', ['styles']); | |
gulp.watch('client/**/*.js', ['scripts']); | |
gulp.watch('client/**/*.html', ['templates']); | |
}); | |
// clean assets | |
gulp.task('clean', function(cb) { | |
return del(['public/css', 'public/js'], cb); | |
}); | |
// bower | |
gulp.task('bower', function(cb){ | |
bower.commands.install([], {save: true}, {}) | |
.on('end', function(installed){ | |
cb(); | |
}); | |
}); | |
// default development | |
gulp.task('default', ['build', 'watch'], function(){ | |
nodemon({ | |
script: 'server.js', | |
watch: 'server/*', | |
env: {NODE_ENV: 'development', DEBUG: true} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment