burnchart/Gruntfile.coffee

97 lines
2.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
2014-10-27 03:35:41 +00:00
2014-10-18 03:32:48 +00:00
pkg: grunt.file.readJSON("package.json")
2014-08-29 02:55:45 +00:00
2014-10-27 03:35:41 +00:00
'clean': [
2014-10-27 02:57:44 +00:00
'public/js'
'public/css'
]
2014-10-27 03:35:41 +00:00
'mkdir':
2014-10-27 02:57:44 +00:00
all:
options:
create: [
'public/js'
'public/css'
]
2014-10-27 03:35:41 +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-27 03:35:41 +00:00
'concat':
css:
2014-10-18 03:32:48 +00:00
src: [
# Vendor dependencies.
2014-10-27 03:10:41 +00:00
'node_modules/normalize.css/normalize.css'
2014-10-18 03:32:48 +00:00
# Our style.
'public/css/app.css'
]
dest: 'public/css/app.bundle.css'
2014-08-29 02:55:45 +00:00
2014-10-27 03:35:41 +00:00
'uglify':
2014-10-27 02:57:44 +00:00
bundle:
files:
2014-10-27 03:10:41 +00:00
'public/js/app.bundle.min.js': 'public/js/app.bundle.js'
2014-10-27 02:57:44 +00:00
2014-10-27 03:35:41 +00:00
'cssmin':
2014-10-27 02:57:44 +00: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-29 04:30:42 +00:00
'watch':
css:
files: [ 'src/styles/**/*.styl' ]
tasks: [ 'stylus', 'concat' ]
options:
spawn: no
2014-10-27 03:35:41 +00:00
'gh-pages':
options:
base: 'public'
2014-10-27 03:39:34 +00:00
branch: 'gh-pages'
message: 'Publish to GitHub Pages'
push: yes
add: yes
2014-10-27 03:45:58 +00:00
src: [
'css/**/*'
'fonts/**/*'
'img/**/*'
'js/**/*'
]
2014-10-27 03:35:41 +00:00
2014-10-27 02:57:44 +00:00
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-10-29 04:30:42 +00:00
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-gh-pages')
2014-08-29 02:55:45 +00:00
# Stylus to CSS, concat all CSS.
2014-10-28 03:13:09 +00:00
grunt.registerTask('css', [
2014-10-27 02:57:44 +00:00
'stylus:app'
'concat:css'
])
# Cleanup public directories.
grunt.registerTask('init', [
'clean'
'mkdir'
])
# Minify JS, CSS and concat JS.
grunt.registerTask('minify', [
2014-10-27 03:10:41 +00:00
'uglify'
'cssmin'
2014-10-18 03:32:48 +00:00
])