2014-08-29 02:55:45 +00:00
|
|
|
module.exports = (grunt) ->
|
2014-10-18 03:32:48 +00:00
|
|
|
grunt.initConfig
|
|
|
|
pkg: grunt.file.readJSON("package.json")
|
2014-08-29 02:55:45 +00:00
|
|
|
|
2014-10-27 02:57:44 +00:00
|
|
|
clean: [
|
|
|
|
'public/js'
|
|
|
|
'public/css'
|
|
|
|
]
|
|
|
|
|
|
|
|
mkdir:
|
|
|
|
all:
|
|
|
|
options:
|
|
|
|
create: [
|
|
|
|
'public/js'
|
|
|
|
'public/css'
|
|
|
|
]
|
|
|
|
|
2014-10-18 03:32:48 +00:00
|
|
|
stylus:
|
2014-10-27 02:57:44 +00:00
|
|
|
app:
|
2014-10-18 03:32:48 +00:00
|
|
|
src: [
|
|
|
|
'src/styles/fonts.styl'
|
|
|
|
'src/styles/icons.styl'
|
|
|
|
'src/styles/chart.styl'
|
|
|
|
'src/styles/notification.styl'
|
|
|
|
'src/styles/app.styl'
|
|
|
|
]
|
|
|
|
dest: 'public/css/app.css'
|
2014-08-29 02:55:45 +00:00
|
|
|
|
2014-10-18 23:57:16 +00:00
|
|
|
concat:
|
2014-10-27 02:57:44 +00:00
|
|
|
vendor:
|
2014-10-18 23:57:16 +00:00
|
|
|
src: [
|
|
|
|
# Vendor dependencies.
|
|
|
|
'vendor/lodash/dist/lodash.js'
|
|
|
|
'vendor/ractive/ractive.js'
|
|
|
|
'vendor/ractive-transitions-fade/ractive-transitions-fade.js'
|
|
|
|
'vendor/ractive-ractive/index.js'
|
|
|
|
'vendor/firebase/firebase.js'
|
|
|
|
'vendor/superagent/superagent.js'
|
|
|
|
'vendor/lscache/lscache.js'
|
|
|
|
'vendor/async/lib/async.js'
|
|
|
|
'vendor/moment/moment.js'
|
|
|
|
'vendor/d3/d3.js'
|
|
|
|
'vendor/d3-tip/index.js'
|
|
|
|
'vendor/marked/lib/marked.js'
|
|
|
|
'vendor/director/build/director.js'
|
2014-10-21 03:25:48 +00:00
|
|
|
'vendor/sorted-index-compare/index.js'
|
2014-10-23 02:59:44 +00:00
|
|
|
'node-semver/semver.js'
|
2014-10-18 23:57:16 +00:00
|
|
|
]
|
|
|
|
dest: 'public/js/vendor.js'
|
|
|
|
options:
|
|
|
|
separator: ';' # for minification purposes
|
2014-08-29 02:55:45 +00:00
|
|
|
|
2014-10-27 02:57:44 +00:00
|
|
|
bundle:
|
|
|
|
src: [
|
|
|
|
'public/js/vendor.min.js'
|
|
|
|
'public/js/app.min.js'
|
|
|
|
]
|
|
|
|
dest: 'public/js/app.bundle.min.js'
|
|
|
|
options:
|
|
|
|
separator: ';' # for minification purposes
|
|
|
|
|
2014-10-18 23:57:16 +00:00
|
|
|
css:
|
2014-10-18 03:32:48 +00:00
|
|
|
src: [
|
|
|
|
# Vendor dependencies.
|
|
|
|
'vendor/normalize-css/normalize.css'
|
|
|
|
# Our style.
|
|
|
|
'public/css/app.css'
|
|
|
|
]
|
|
|
|
dest: 'public/css/app.bundle.css'
|
2014-08-29 02:55:45 +00:00
|
|
|
|
2014-10-27 02:57:44 +00:00
|
|
|
uglify:
|
|
|
|
bundle:
|
|
|
|
files:
|
|
|
|
'public/js/app.min.js': 'public/js/app.js'
|
|
|
|
'public/js/vendor.min.js': 'public/js/vendor.js'
|
|
|
|
|
|
|
|
cssmin:
|
|
|
|
bundle:
|
|
|
|
files:
|
|
|
|
'public/css/app.min.css': 'public/css/app.css'
|
|
|
|
'public/css/app.bundle.min.css': 'public/css/app.bundle.css'
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-mkdir')
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean')
|
2014-10-18 03:32:48 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-stylus')
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat')
|
2014-10-27 02:57:44 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify')
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-cssmin')
|
2014-08-29 02:55:45 +00:00
|
|
|
|
2014-10-27 02:57:44 +00:00
|
|
|
# Stylus to CSS, concat JS libs and all CSS.
|
2014-10-18 03:32:48 +00:00
|
|
|
grunt.registerTask('default', [
|
2014-10-27 02:57:44 +00:00
|
|
|
'stylus:app'
|
|
|
|
'concat:vendor'
|
|
|
|
'concat:css'
|
|
|
|
])
|
|
|
|
|
|
|
|
# Cleanup public directories.
|
|
|
|
grunt.registerTask('init', [
|
|
|
|
'clean'
|
|
|
|
'mkdir'
|
|
|
|
])
|
|
|
|
|
|
|
|
# Minify JS, CSS and concat JS.
|
|
|
|
grunt.registerTask('minify', [
|
|
|
|
'uglify:bundle'
|
|
|
|
'cssmin:bundle'
|
|
|
|
'concat:bundle'
|
2014-10-18 03:32:48 +00:00
|
|
|
])
|