-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathGruntfile.js
93 lines (81 loc) · 2.15 KB
/
Gruntfile.js
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
module.exports = function(grunt) {
'use strict';
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-mocha');
var port = 8899;
// ==========================================================================
// Project configuration
// ==========================================================================
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: port,
base: '.'
}
}
},
requirejs: {
compile: {
options: {
baseUrl: '.',
optimize: 'none',
paths: {
aura: 'lib',
jquery: 'empty:',
underscore: 'empty:',
eventemitter: 'components/eventemitter2/lib/eventemitter2'
},
shim: {
underscore: { exports: '_' }
},
include: ['aura/aura', 'aura/aura.extensions', 'aura/ext/debug', 'aura/ext/mediator', 'aura/ext/widgets'],
exclude: ['jquery'],
out: 'dist/aura.js'
}
}
},
jshint: {
files: {
src: ['lib/**/*.js', 'spec/lib/**/*.js']
},
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
eqnull: true,
browser: true,
nomen: false,
expr: true,
globals: {
console: true,
require: true,
define: true,
_: true,
$: true,
}
}
},
mocha: {
aura: ["spec/index.html"]
},
watch: {
files: ['lib/**/*.js', 'spec/lib/**/*.js'],
tasks: ['build']
}
});
// default build task
grunt.registerTask('build', ['jshint', 'mocha', 'requirejs']);
grunt.registerTask('default', ['connect', 'build', 'watch']);
grunt.registerTask('spec', ['bower', 'connect', 'build']);
};