2014-04-01 19:33:29 +00:00
|
|
|
module.exports = (grunt) ->
|
|
|
|
|
|
|
|
grunt.initConfig
|
|
|
|
|
|
|
|
pkg: grunt.file.readJSON 'package.json'
|
|
|
|
|
|
|
|
concat:
|
|
|
|
|
2014-04-01 22:25:54 +00:00
|
|
|
view:
|
2014-04-01 22:18:25 +00:00
|
|
|
|
|
|
|
options:
|
|
|
|
separator: "\n"
|
|
|
|
src: [
|
|
|
|
'bower_components/jQuery/dist/jquery.min.js'
|
|
|
|
'bower_components/js-md5/js/md5.min.js'
|
|
|
|
'bower_components/mousetrap/mousetrap.min.js'
|
|
|
|
'bower_components/mousetrap/plugins/global-bind/mousetrap-global-bind.min.js'
|
|
|
|
'../assets/js/_frameworks.js'
|
2014-04-01 22:25:54 +00:00
|
|
|
'../assets/js/build.js'
|
|
|
|
'../assets/js/view/main.js'
|
2014-04-01 22:18:25 +00:00
|
|
|
]
|
2014-04-01 22:25:54 +00:00
|
|
|
dest: '../assets/min/view.js'
|
2014-04-01 22:18:25 +00:00
|
|
|
|
2014-04-01 19:33:29 +00:00
|
|
|
js:
|
|
|
|
options:
|
|
|
|
separator: "\n"
|
|
|
|
src: [
|
|
|
|
'bower_components/jQuery/dist/jquery.min.js'
|
|
|
|
'bower_components/js-md5/js/md5.min.js'
|
|
|
|
'bower_components/mousetrap/mousetrap.min.js'
|
|
|
|
'bower_components/mousetrap/plugins/global-bind/mousetrap-global-bind.min.js'
|
|
|
|
'../assets/js/*.js'
|
|
|
|
]
|
|
|
|
dest: '../assets/min/main.js'
|
|
|
|
|
|
|
|
css:
|
|
|
|
options:
|
|
|
|
separator: "\n"
|
|
|
|
src: [
|
|
|
|
'../assets/css/*.css'
|
|
|
|
]
|
|
|
|
dest: '../assets/min/main.css'
|
|
|
|
|
|
|
|
uglify:
|
|
|
|
|
2014-04-01 22:25:54 +00:00
|
|
|
view:
|
|
|
|
options:
|
2014-04-04 16:50:58 +00:00
|
|
|
banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
|
2014-04-01 22:25:54 +00:00
|
|
|
files:
|
|
|
|
'../assets/min/view.js': '../assets/min/view.js'
|
|
|
|
|
2014-04-01 19:33:29 +00:00
|
|
|
assets:
|
|
|
|
options:
|
2014-04-04 16:50:58 +00:00
|
|
|
banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
|
2014-04-01 19:33:29 +00:00
|
|
|
files:
|
|
|
|
'../assets/min/main.js': '../assets/min/main.js'
|
|
|
|
|
|
|
|
cssmin:
|
|
|
|
|
|
|
|
assets:
|
|
|
|
options:
|
2014-04-04 16:50:58 +00:00
|
|
|
banner: '/*! <%= pkg.name %> <%= pkg.version %> */'
|
2014-04-01 19:33:29 +00:00
|
|
|
files:
|
|
|
|
'../assets/min/main.css': '../assets/min/main.css'
|
|
|
|
|
|
|
|
watch:
|
|
|
|
|
|
|
|
js:
|
|
|
|
files: [
|
|
|
|
'../assets/js/*.js'
|
|
|
|
]
|
|
|
|
tasks: ['js']
|
|
|
|
options:
|
|
|
|
spawn: false
|
|
|
|
interrupt: true
|
|
|
|
|
|
|
|
css:
|
|
|
|
files: [
|
|
|
|
'../assets/css/*.css'
|
|
|
|
]
|
|
|
|
tasks: ['css']
|
|
|
|
options:
|
|
|
|
spawn: false
|
|
|
|
interrupt: true
|
|
|
|
|
|
|
|
require('load-grunt-tasks')(grunt)
|
|
|
|
|
|
|
|
grunt.registerTask 'default', ->
|
|
|
|
grunt.task.run [
|
2014-04-01 22:25:54 +00:00
|
|
|
'view'
|
2014-04-01 19:33:29 +00:00
|
|
|
'js'
|
|
|
|
'css'
|
|
|
|
]
|
|
|
|
|
2014-04-01 22:25:54 +00:00
|
|
|
grunt.registerTask 'view', [
|
|
|
|
'concat:view'
|
|
|
|
'uglify:view'
|
|
|
|
]
|
|
|
|
|
2014-04-01 19:33:29 +00:00
|
|
|
grunt.registerTask 'js', [
|
|
|
|
'concat:js'
|
|
|
|
'uglify:assets'
|
|
|
|
]
|
|
|
|
|
|
|
|
grunt.registerTask 'css', [
|
|
|
|
'concat:css'
|
|
|
|
'cssmin:assets'
|
|
|
|
]
|