forked from acumenbrands/khan.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
43 lines (37 loc) · 1.07 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
module.exports = (grunt)->
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-mocha-test')
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
coffee:
options:
join: true
sourceMap: true
sourceMapDir: 'tmp/maps'
compile:
src: ['src/**/*.coffee']
dest: 'dist/khan.js'
ext: '.js'
copy:
sourcemap:
src: 'tmp/khan.src.coffee'
dest: 'dist/maps/khan.src.coffee'
map:
src: 'tmp/mapskhan.js.map'
dest: 'dist/maps/mapskhan.js.map'
mochaTest:
unit:
options:
reporter: 'spec'
require: ['coffee-script', './spec/spec_helper.coffee']
src: ['spec/**/*.coffee']
uglify:
build:
sourceMap: true
sourceMapIn: 'tmp/maps/mapskhan.js.map'
files:
'dist/khan.min.js' : ['dist/khan.js'],
grunt.registerTask 'test', ['mochaTest:unit']
grunt.registerTask 'build', ['coffee','uglify', 'copy']