-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
55 lines (50 loc) · 1.45 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
module.exports = (grunt) ->
# Load required installed tasks.
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-coffeelint"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-ngmin"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-copy"
# Configure tasks.
grunt.initConfig
pkg: grunt.file.readJSON "package.json"
clean: [ "bin" ]
coffeelint:
files: [ "src/<%= pkg.name %>.coffee" ]
options:
max_line_length:
level: "ignore"
coffee:
build:
options:
bare: true
expand: true
src: [ "<%= pkg.name %>.coffee" ]
cwd: "src"
dest: "bin"
ext: ".js"
ngmin:
files:
src: [ "<%= pkg.name %>.js" ]
cwd: "bin"
dest: "bin"
expand: true
uglify:
build:
files:
"bin/<%= pkg.name %>.min.js": "bin/<%= pkg.name %>.js"
delta:
options:
livereload: true
cwd: "src"
files: [ "<%= pkg.name %>.coffee" ]
tasks: [ "coffeelint", "coffee" ]
# Register build task.
grunt.registerTask "build", [ "clean", "coffeelint", "coffee", "ngmin", "uglify" ]
# Register watch task. This task does a build before watching.
grunt.renameTask "watch", "delta"
grunt.registerTask "watch", [ "build", "delta" ]
# Register default task.
grunt.registerTask "default", [ "build" ]