-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGruntfile.js
More file actions
68 lines (63 loc) · 2.13 KB
/
Gruntfile.js
File metadata and controls
68 lines (63 loc) · 2.13 KB
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
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
jshint: {
compile: {
files: [{
src: ['src/modules/**/*.js', 'Gruntfile.js', 'src/app.js']
}],
options: {
jshintrc: '.jshintrc'
}
}
},
copy: {
main: {
files: [
{ // all minified libraries, path flattened
expand: true,
flatten: true,
cwd: '.',
dest: 'out/lib/',
src: ['src/lib/**/*.min.js'],
filter: 'isFile'
},
{ // css files
dest: 'out/',
src: ['css/bootstrap.min.css']
},
{ // template files
expand: true,
dest: 'out/',
src: ['src/**/*.html']
},
{ // production only files
expand: true,
cwd: 'production/',
dest: 'out/',
src: ['index.html', 'bootstrap.js']
}
]
}
},
requirejs: {
compile: {
options: {
baseUrl: 'src',
mainConfigFile: 'bootstrap.js',
include: ['app'], // build the file outgoing from the app.js require dependencies
out: 'out/app.js',
paths: { // don't include the libraries!
'jQuery': 'empty:',
'angular': 'empty:',
'angular-ui-router': 'empty:'
}
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('default', ['jshint', 'copy', 'requirejs']);
};