-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
68 lines (66 loc) · 2.43 KB
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
module.exports = (grunt) ->
grunt.initConfig
pkg : grunt.file.readJSON('package.json')
concurrent :
dev :
tasks : ['watch', 'nodemon']
options : logConcurrentOutput : true
nodemon :
dev :
script : 'server.js'
options :
cwd : __dirname
ext : 'js'
watch : ['app']
ignore : ['app/public', 'app/views']
delay : 3
browserify :
default :
src : 'app-src/views/js/index.coffee'
dest : 'app/public/js/dist.js'
options :
transform : ['coffeeify', 'jadeify']
alias : ['./app-src/views/js/lib/page.coffee:page']
debug : true
uglify :
default :
src : 'app/public/js/dist.js'
dest : 'app/public/js/dist.min.js'
stylus :
dev :
files : { 'app/public/css/screen.css' : 'app-src/views/styl/screen.styl' }
options :
compress : no
use : [require('nib')]
prod :
files : { 'app/public/css/screen.min.css' : 'app-src/views/styl/screen.styl' }
options :
compress : yes
use : [require('nib')]
jade :
default :
files : { 'app/public/index.html' : 'app-src/views/home/index.jade' }
options :
data : (dest, src) ->
return require './config.json'
debug : no
watch :
views :
files : ['app-src/views/js/**/*.coffee', 'app-src/views/js/**/*.jade']
tasks : ['javascript']
stylus :
files : ['app-src/views/styl/**/*.styl']
tasks : ['stylus']
jade :
files : ['app-src/views/**/*.jade']
tasks : ['jade']
grunt.loadNpmTasks 'grunt-concurrent'
grunt.loadNpmTasks 'grunt-nodemon'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-browserify'
grunt.loadNpmTasks 'grunt-contrib-stylus'
grunt.loadNpmTasks 'grunt-contrib-jade'
grunt.registerTask 'javascript', ['browserify', 'uglify']
grunt.registerTask 'start-dev-server', ['default', 'concurrent:dev']
grunt.registerTask 'default', ['javascript', 'stylus', 'jade']