-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.coffee
73 lines (59 loc) · 2.06 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
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
browserify:
development:
files:
'build/compiled-dev.js': ['src/main.coffee']
options:
browserifyOptions:
extensions: ['.coffee', '.js']
transform: ['coffeeify', ['envify', NODE_ENV: 'development']]
production:
files:
'build/compiled-prod.js': ['src/main.coffee']
options:
browserifyOptions:
extensions: ['.coffee', '.js']
transform: ['coffeeify', ['envify', NODE_ENV: 'production']]
tests:
files:
'compiled/all-tests.js': ['src/main.coffee', 'test/test_helper.coffee', 'test/*.coffee']
options:
browserifyOptions:
extensions: ['.coffee', '.js']
transform: ['coffeeify']
uglify:
production:
files:
'build/compiled-prod.js': ['build/compiled-prod.js']
watch:
grunt:
files: ["Gruntfile.coffee"]
main:
files: ["src/*.coffee"]
tasks: ["compile"]
tests:
files: ["test/*.coffee", "test/**/*.coffee", "src/*.coffee", "src/**/*.js"]
tasks: ["browserify:tests"]
trimtrailingspaces:
development:
src: ['build/compiled-dev.js']
mocha:
all:
src: ['test/runner.html']
options:
run: true
log: true
reporter: 'Spec'
grunt.loadNpmTasks('grunt-browserify')
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-mocha')
grunt.loadNpmTasks("grunt-contrib-watch")
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-trimtrailingspaces')
grunt.registerTask "compile:production", ["browserify:production", "uglify"]
grunt.registerTask "compile:development", ["browserify:development", "trimtrailingspaces:development"]
grunt.registerTask "compile", ["compile:development", "compile:production"]
grunt.registerTask "test", ["browserify:tests", "mocha"]
grunt.registerTask "default", ["compile", "browserify:tests", "watch"]