-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathGruntfile.coffee
62 lines (54 loc) · 1.62 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
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
name: "hotkeys"
coffee:
src:
options:
bare: true
files:
'lib/<%= name %>.js': 'src/<%= name %>.coffee'
spec:
files:
'spec/<%= name %>-spec.js': 'spec/<%= name %>-spec.coffee'
umd:
all:
src: 'lib/<%= name %>.js'
template: 'umd.hbs'
amdModuleId: '<%= pkg.name %>'
objectToExport: '<%= name %>'
globalAlias: '<%= name %>'
deps:
'default': ['$', 'SimpleModule']
amd: ['jquery', 'simple-module']
cjs: ['jquery', 'simple-module']
global:
items: ['jQuery', 'SimpleModule']
prefix: ''
watch:
spec:
files: ['spec/**/*.coffee']
tasks: ['coffee:spec']
src:
files: ['src/**/*.coffee']
tasks: ['coffee:src', 'umd']
jasmine:
files: ['lib/**/*.js', 'spec/**/*.js']
tasks: 'jasmine'
jasmine:
test:
src: ['lib/**/*.js']
options:
outfile: 'spec/index.html'
styles: 'styles/<%= name %>.css'
specs: 'spec/<%= name %>-spec.js'
vendor: [
'vendor/bower/jquery/dist/jquery.min.js'
'vendor/bower/simple-module/lib/module.js'
]
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-jasmine'
grunt.loadNpmTasks 'grunt-umd'
grunt.registerTask 'default', ['coffee', 'umd', 'jasmine', 'watch']
grunt.registerTask 'test', ['coffee', 'umd', 'jasmine']