-
Notifications
You must be signed in to change notification settings - Fork 7
/
Gruntfile.coffee
114 lines (100 loc) · 2.97 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#global module:false
module.exports = (grunt) ->
"use strict"
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
banner: '/**!\n
* <%= pkg.name %>\n
* <%= pkg.description %>\n
*\n
* @license <%= pkg.license %>\n
* @author <%= pkg.author.name %> - <%= pkg.author.url %>\n
* @version <%= pkg.version %>\n
**/'
watch:
reloadcss:
options: {livereload: true}
files: ["assets/styles/*.css"]
reloadjs:
options: {livereload: true}
files: ["src/**"]
reloadhtml:
options: {livereload: true}
files: ["**.html"]
jschecks:
files: ["tests/**", "src/**"]
tasks: ["jshint", "karma:ci"]
notify:
build:
options: {message: "Build complete"}
karma:
options:
configFile: 'karma.conf.js'
ci:
browsers: ['PhantomJS']
singleRun: true
coverage:
browsers: ['PhantomJS']
reporters: ['coverage']
preprocessors:
'src/**/*.js': ['coverage']
coverageReporter:
type: 'lcov'
dir: 'coverage/'
singleRun: true
coveralls:
options:
debug: true
coverage_dir: 'coverage'
jshint:
all: ['src/**']
clean: ['dist']
concat:
vanilla:
src: ['src/draggable-number.js']
dest: 'dist/draggable-number.js'
jquery:
src: ['src/draggable-number.js', 'src/wrappers/jquery.draggable-number.js']
dest: 'dist/jquery.draggable-number.js'
umd:
vanilla:
src: 'dist/draggable-number.js'
dest: 'dist/draggable-number.js'
objectToExport: 'DraggableNumber'
jquery:
src: 'dist/jquery.draggable-number.js'
dest: 'dist/jquery.draggable-number.js'
objectToExport: 'DraggableNumber'
deps:
'default': ['$']
amd: ['jquery']
cjs: ['jquery']
global: ['jQuery']
uglify:
options:
report: 'gzip'
build:
files:
'dist/draggable-number.min.js': ['dist/draggable-number.js']
'dist/jquery.draggable-number.min.js': ['dist/jquery.draggable-number.js']
usebanner:
all:
options:
banner: '<%= banner %>'
files:
src: ['dist/*.js']
# Load necessary plugins
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-notify"
grunt.loadNpmTasks "grunt-umd"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-banner"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-jshint"
grunt.loadNpmTasks "grunt-karma"
grunt.loadNpmTasks "grunt-karma-coveralls"
grunt.registerTask "default", ["karma:ci", "jshint", "watch"]
grunt.registerTask "build", ["clean", "karma:ci", "jshint", "concat", "umd", "uglify", "usebanner", "notify:build"]
grunt.registerTask "test", ["jshint", "karma:ci"]
grunt.registerTask "coverage", ["karma:coverage", "coveralls"]