-
Notifications
You must be signed in to change notification settings - Fork 28
/
Gruntfile.coffee
50 lines (40 loc) · 1.31 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
module.exports = (grunt) ->
grunt.initConfig
package: grunt.file.readJSON 'package.json'
outputFileName: '<%= package.name %>-<%= package.version %>'
coffeelint:
all:
src: ['source/*.coffee', 'tests/*.coffee']
clean:
all: ['distribution/*']
coffee:
all:
expand: yes
cwd: 'source/'
src: ['*.coffee']
dest: 'distribution/'
ext: '.js'
exec:
test:
cmd:
'./node_modules/.bin/jasmine-node --coffee --noStack tests/'
browserify2:
compile:
options:
expose:
'data-structures': './distribution/index.js'
entry: './distribution/index.js'
compile: 'distribution/browser/<%= outputFileName %>.js'
uglify:
all:
src: ['distribution/browser/<%= outputFileName %>.js']
dest: 'distribution/browser/<%= outputFileName %>.min.js'
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-browserify2'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-exec'
grunt.registerTask 'test', [ 'exec:test' ]
grunt.registerTask 'default', ['coffeelint', 'test', 'clean', 'coffee',
'browserify2', 'uglify']