forked from airbrake/airbrake-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
90 lines (72 loc) · 1.96 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
module.exports = (grunt) ->
# Interpolates pkg variables into files during browserification.
addPackageVars = (file) ->
through = require('through')
write = (buf) ->
data += grunt.template.process(buf, {pkg: pkgData})
end = ->
@queue(data)
@queue(null)
data = ''
through(write, end)
pkgData = grunt.file.readJSON('package.json')
grunt.initConfig
pkg: pkgData
browserify:
options:
transform: ['coffeeify', addPackageVars]
stack:
src: ['src/notifier.coffee']
dest: 'dist/airbrake.js'
uglify:
options:
sourceMap: 'dist/airbrake.min.map'
sourceMappingURL: 'airbrake.min.map'
sourceMapPrefix: 1
dist:
files: [{
expand: true
cwd: 'dist/'
src: 'airbrake.js'
dest: 'dist'
ext: '.min.js'
}]
watch:
test_only:
files: ['test/**/*.coffee']
tasks: ['test']
options:
interrupt: true
build_and_test:
files: ['test/**/*.coffee']
tasks: ['build', 'test']
options:
interrupt: true
connect:
server:
options:
port: 9001
keepalive: true
integration_test:
options:
hostname: "*"
port: 9001
base: "."
keepalive: true
mochacli:
all: ["test/**/*.coffee"]
options:
compilers: ["coffee:coffee-script"]
files: "test/**/*.coffee"
bail: true
reporter: "spec"
require("load-grunt-tasks") grunt
grunt.registerTask("test", ["mochacli"])
# Running the `serve` command starts up a webserver.
grunt.registerTask("serve", ["connect"])
grunt.registerTask("build", ["browserify"])
grunt.registerTask("minify", ["uglify"])
grunt.registerTask("default", ["build", "minify"])
# Push distribution libraries to CDN.
# Build and publish distribution site.
grunt.registerTask("publish", [])