-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.coffee
74 lines (70 loc) · 1.97 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
69
70
71
72
73
74
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
uglify:
project:
build:
src: 'src/js/<%= pkg.name %>.js'
dest: 'build/<%= pkg.name %>.min.js'
examples:
src: 'devserver/public/js/exampleapp.js'
dest: 'devserver/public/build/exampleapp.min.js'
coffee:
options:
join: true
project:
files:
'src/js/<%= pkg.name %>.js':
[
'src/coffee/*.coffee'
]
public:
files:
'devserver/public/js/exampleapp.js':
[
'devserver/public/coffee/*.coffee'
]
devserver:
files:
'devserver/build/js/devserver.js':
[
'devserver/build/coffee/*.coffee'
]
express:
options: {}
dev:
options:
script: 'devserver/build/js/devserver.js'
watch:
project:
files: 'src/coffee/*.coffee'
tasks:
[
'coffee:project',
'uglify:project'
]
examples:
files: 'devserver/public/coffee/*.coffee'
tasks:
[
'coffee:public'
]
devserver:
files: 'devserver/build/coffee/*.coffee'
tasks:
[
'coffee:devserver',
'express:dev'
]
options:
spawn: false
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-express-server'
grunt.registerTask 'default', ['coffee:project', 'uglify:project']
grunt.registerTask 'dev-project', ['coffee:project', 'uglify:project', 'watch:project']
grunt.registerTask 'dev-public', ['coffee:public', 'watch:public']
grunt.registerTask 'dev-server', ['coffee:devserver', 'watch:devserver']
grunt.registerTask 'dev-full', ['coffee', 'uglify', 'express:dev', 'watch']
return