/
Gruntfile.coffee
executable file
·72 lines (68 loc) · 1.86 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
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
includes:
files:
src: ['src/jquery.tracking.coffee']
dest: 'tmp'
flatten: true
cwd: '.'
options:
includeRegexp: /^(\s*)#=\s*include\s+(\S+)\s*$/
silent: true
banner: '# <% includes.files.dest %>'
coffee:
compile:
files:
'dist/jquery.tracking.js': 'tmp/jquery.tracking.coffee'
'spec/test.spec.js': 'spec/test.spec.coffee'
coffeelint:
app:
[ 'src/*.coffee' ]
uglify:
options:
banner: '/*! <%= pkg.name %> v<%= pkg.version %> | <%= pkg.license %> */\n'
build:
files: 'dist/jquery.tracking.min.js': 'dist/jquery.tracking.js'
compress:
main:
options:
mode: 'gzip'
files: [ {
src: [ 'dist/jquery.tracking.min.js' ]
dest: 'dist/jquery.tracking.js.gz'
}]
jasmine:
specs:
src: 'dist/jquery.tracking.js'
options:
specs: 'spec/*spec.js'
vendor: [
"bower_components/jquery/dist/jquery.min.js"
"bower_components/js-cookie/src/js.cookie.js"
"bower_components/js-url/url.min.js"
"bower_components/jquery.debug/dist/jquery.debug.min.js"
"bower_components/jasmine-jquery/lib/jasmine-jquery.js"
]
watch:
options: livereload: true
files: '{src,spec}/*.coffee'
tasks: 'default'
# Loading dependencies
for key of grunt.file.readJSON('package.json').devDependencies
if key != 'grunt' and key.indexOf('grunt') == 0
grunt.loadNpmTasks key
grunt.registerTask 'default', [
'includes'
'coffeelint'
'coffee'
'jasmine'
'uglify'
'compress'
]
grunt.registerTask 'test', [
'includes'
'coffee'
'jasmine'
]