-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
102 lines (87 loc) · 2.17 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
94
95
96
97
98
99
100
101
102
module.exports = function ( grunt ) {
// Config ///////////////////////////////////////////////////////////////////
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
// Task config ////////////////////////////////////////////////////////////
clean: {
options: { force: true },
prebuild: {
src: [ './dist/*', './tmp/*' ]
},
postbuild: {
src: [ './tmp' ]
}
},
concat: {
core: {
src: [
'./src/lib/GoogleMap.js',
'./src/lib/Marker.js',
'./src/lib/Cluster.js',
'./src/lib/utility.js'
],
dest: './tmp/core.js',
nonull: true
},
provider: {
src: './src/googleMaps.provider.js',
dest: './tmp/provider.js',
options: {
process: function ( src ) {
return grunt.template.process( src, { data: {
guts: grunt.file.read( './tmp/core.js' )
}});
}
}
},
build: {
src: [
'./src/googleMaps.module.js',
'./src/googleMaps.directive.js',
'./tmp/provider.js'
],
dest: './dist/googly-mapulous.js',
nonull: true
}
},
uglify: {
build: {
src: './dist/googly-mapulous.js',
dest: './dist/googly-mapulous.min.js'
}
},
doxx: {
build: {
src: './src',
target: './docs',
options: {
title: 'Angular Googly Mapulous',
readme: './README.md'
}
}
},
watch: {
build: {
files: './src/**/*.js',
tasks: 'build'
}
}
});
// Tasks ////////////////////////////////////////////////////////////////////
// Automatically load default tasks from packages
require('load-grunt-tasks')( grunt );
// Build task
var buildTasks = [
'clean:prebuild',
'concat:core',
'concat:provider',
'concat:build',
'uglify:build',
'clean:postbuild',
'doxx'
];
grunt.registerTask( 'build', buildTasks );
grunt.registerTask( 'dev', 'watch' );
// Default task - this just mirrors the build task
grunt.registerTask( 'default', buildTasks );
};