burnchart/Gruntfile.coffee

111 lines
3.0 KiB
CoffeeScript
Raw Normal View History

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")
clean: [ 'public/js' ]
2014-08-30 17:17:46 +00:00
2014-10-18 03:32:48 +00:00
browserify:
commonjs:
src: 'src/app.coffee'
dest: 'public/js/app.bundle.js'
options:
transform: [
# CoffeeScript.
'coffeeify'
# Mustaches.
'ractivate'
]
alias: [
'./vendor/d3-tip/index.js:d3-tip'
'./vendor/firebase-simple-login/firebase-simple-login.js:firebase-simple-login'
]
2014-08-29 02:55:45 +00:00
2014-10-18 03:32:48 +00:00
stylus:
compile:
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
# concat:
# scripts:
# src: [
# # CommonJS loader.
# 'public/js/commonjs.js'
# # 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/firebase-simple-login/firebase-simple-login.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'
# # Our app.
# 'public/js/app.js'
# ]
# dest: 'public/js/app.bundle.js'
# options:
# separator: ';' # for minification purposes
2014-08-29 02:55:45 +00:00
2014-10-18 03:32:48 +00:00
styles:
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-18 03:32:48 +00:00
uglify:
scripts:
files:
'public/js/app.min.js': 'public/js/app.js'
'public/js/app.bundle.min.js': 'public/js/app.bundle.js'
2014-08-29 02:55:45 +00:00
2014-10-18 03:32:48 +00:00
cssmin:
combine:
files:
'public/css/app.min.css': 'public/css/app.css'
'public/css/app.bundle.min.css': 'public/css/app.bundle.css'
2014-08-29 02:55:45 +00:00
2014-10-18 03:32:48 +00:00
watchify:
scripts:
files: "src/**/*.*"
tasks: [ "default" ]
options:
interrupt: true # interrupt build when a file has changed?
debounceDelay: 250 # delay a bit
livereload: true
2014-09-14 16:33:15 +00:00
2014-10-18 03:32:48 +00:00
grunt.loadNpmTasks('grunt-browserify')
grunt.loadNpmTasks('grunt-contrib-stylus')
grunt.loadNpmTasks('grunt-contrib-concat')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-cssmin')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-watchify')
2014-08-29 02:55:45 +00:00
2014-10-18 03:32:48 +00:00
grunt.registerTask('default', [
'clean'
'browserify'
'stylus'
#'concat'
])
2014-08-29 02:55:45 +00:00
2014-10-18 03:32:48 +00:00
grunt.registerTask('minify', [
'uglify'
'cssmin'
])