burnchart/Gruntfile.coffee

89 lines
1.9 KiB
CoffeeScript
Raw Normal View History

2014-08-28 19:55:45 -07:00
module.exports = (grunt) ->
2014-10-17 20:32:48 -07:00
grunt.initConfig
2014-10-26 21:35:41 -06:00
2014-10-17 20:32:48 -07:00
pkg: grunt.file.readJSON("package.json")
2014-08-28 19:55:45 -07:00
2014-10-26 21:35:41 -06:00
'clean': [
2014-10-26 19:57:44 -07:00
'public/js'
'public/css'
]
2014-10-26 21:35:41 -06:00
'mkdir':
2014-10-26 19:57:44 -07:00
all:
options:
create: [
'public/js'
'public/css'
]
2014-10-26 21:35:41 -06:00
'stylus':
2014-10-26 19:57:44 -07:00
app:
2014-10-17 20:32:48 -07: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-28 19:55:45 -07:00
2014-10-26 21:35:41 -06:00
'concat':
css:
2014-10-17 20:32:48 -07:00
src: [
# Vendor dependencies.
2014-10-26 21:10:41 -06:00
'node_modules/normalize.css/normalize.css'
2014-10-17 20:32:48 -07:00
# Our style.
'public/css/app.css'
]
dest: 'public/css/app.bundle.css'
2014-08-28 19:55:45 -07:00
2014-10-26 21:35:41 -06:00
'uglify':
2014-10-26 19:57:44 -07:00
bundle:
files:
2014-10-26 21:10:41 -06:00
'public/js/app.bundle.min.js': 'public/js/app.bundle.js'
2014-10-26 19:57:44 -07:00
2014-10-26 21:35:41 -06:00
'cssmin':
2014-10-26 19:57:44 -07:00
bundle:
files:
'public/css/app.min.css': 'public/css/app.css'
'public/css/app.bundle.min.css': 'public/css/app.bundle.css'
2014-10-26 21:35:41 -06:00
'gh-pages':
options:
base: 'public'
2014-10-26 21:39:34 -06:00
branch: 'gh-pages'
message: 'Publish to GitHub Pages'
push: yes
add: yes
2014-10-26 21:45:58 -06:00
src: [
'css/**/*'
'fonts/**/*'
'img/**/*'
'js/**/*'
]
2014-10-26 21:35:41 -06:00
2014-10-26 19:57:44 -07:00
grunt.loadNpmTasks('grunt-mkdir')
grunt.loadNpmTasks('grunt-contrib-clean')
2014-10-17 20:32:48 -07:00
grunt.loadNpmTasks('grunt-contrib-stylus')
grunt.loadNpmTasks('grunt-contrib-concat')
2014-10-26 19:57:44 -07:00
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-cssmin')
2014-10-26 21:35:41 -06:00
grunt.loadNpmTasks('grunt-gh-pages');
2014-08-28 19:55:45 -07:00
# Stylus to CSS, concat all CSS.
2014-10-27 21:13:09 -06:00
grunt.registerTask('css', [
2014-10-26 19:57:44 -07:00
'stylus:app'
'concat:css'
])
# Cleanup public directories.
grunt.registerTask('init', [
'clean'
'mkdir'
])
# Minify JS, CSS and concat JS.
grunt.registerTask('minify', [
2014-10-26 21:10:41 -06:00
'uglify'
'cssmin'
2014-10-17 20:32:48 -07:00
])