-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGruntfile.js
73 lines (67 loc) · 2.24 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Compiles coffeescript for the client side
coffee: {
compile: {
options:{
bare: true
},
files: {
'index.js': 'src/index.coffee',
'lib/route.js': 'src/route.coffee',
'lib/routeBrowserManager.js': 'src/routeBrowserManager.coffee',
'lib/routeManager.js': 'src/routeManager.coffee'
}
}
},
// Executes unitTest
cafemocha: {
express_shared_routes: {
src: 'test/*.coffee',
options: {
ui: 'bdd',
require: [
'should'
]
}
}
},
umd: {
browserManager: {
src: 'lib/routeBrowserManager.js',
objectToExport: 'RouteBrowserManager', // internal object that will be exported
globalAlias: 'RouteManager', // changes the name of the global variable
amdModuleId: 'RouteManager',
deps: {
'default': ['Route']
}
},
route: {
src: 'lib/route.js',
objectToExport: 'Route', // internal object that will be exported
globalAlias: 'Route', // changes the name of the global variable
amdModuleId: 'Route',
}
},
uglify: {
my_target: {
options: {
report: 'gzip'
},
files: {
'routeManager.min.js': ['lib/route.js', 'lib/routeBrowserManager.js']
}
}
}
});
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-umd');
grunt.loadNpmTasks('grunt-cafe-mocha');
// Default task(s).
grunt.registerTask('default', ['coffee','umd', 'uglify']);
grunt.registerTask('test', ['coffee','umd','cafemocha']);
};