forked from Pathgather/please-wait
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
84 lines (82 loc) · 2.17 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
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-compass'
grunt.loadNpmTasks 'grunt-contrib-jasmine'
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
compass:
dist:
options:
sassDir: 'src',
cssDir: 'build'
meta:
banner: """
/**
* <%= pkg.name %>
* <%= pkg.description %>\n
* @author <%= pkg.author.name %> <<%= pkg.author.email %>>
* @copyright <%= pkg.author.name %> <%= grunt.template.today('yyyy') %>
* @license <%= pkg.licenses[0].type %> <<%= pkg.licenses[0].url %>>
* @link <%= pkg.homepage %>
* @module <%= pkg.module %>
* @version <%= pkg.version %>
*/\n
"""
coffeelint:
src: 'src/**/*.coffee'
options:
max_line_length:
level: 'ignore'
clean:
dist:
build: ["compile/**", "build/**"]
test:
build: ["compile/**"]
coffee:
compile:
files: [
expand: true
cwd: 'src/'
src: '**/*.coffee'
dest: 'compile/'
ext: '.js'
],
options:
bare: true
test:
files: [
expand: true,
cwd: 'spec',
src: '**/*.coffee',
dest: 'compile/spec',
ext: '.js'
]
concat:
options:
banner: '<%= meta.banner %>'
dist:
src: 'compile/please-wait.js'
dest: 'build/please-wait.js'
uglify:
options:
banner: '<%= meta.banner %>'
dist:
src: ['build/please-wait.js']
dest: 'build/please-wait.min.js'
jasmine:
please_wait:
src: 'compile/**/*.js'
options:
specs: 'compile/spec/*.spec.js',
helpers: 'compile/spec/*.helper.js'
grunt.registerTask 'default', ['coffeelint', 'clean', 'compass', 'coffee', 'concat', 'uglify']
grunt.registerTask 'test', [
'coffeelint',
'clean:test',
'coffee',
'jasmine'
]