forked from Reportr/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
115 lines (100 loc) · 3.62 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
103
104
105
106
107
108
109
110
111
112
113
114
115
var path = require("path");
var _ = require("lodash");
var pkg = require("./package.json");
module.exports = function (grunt) {
// Path to the client src
var srcPath = path.resolve(__dirname, "public/src");
// Load grunt modules
grunt.loadNpmTasks('grunt-hr-builder');
grunt.loadNpmTasks("grunt-bower-install-simple");
// Init GRUNT configuraton
grunt.initConfig({
"pkg": pkg,
"bower-install-simple": {
options: {
color: true,
production: false,
directory: "public/src/vendors"
}
},
"hr": {
"app": {
"source": path.resolve(__dirname, "node_modules/happyrhino"),
// Base directory for the application
"base": srcPath,
// Application name
"name": "Reportr",
// Mode debug
"debug": true,
// Main entry point for application
"main": "main",
// Build output directory
"build": path.resolve(__dirname, "public/build"),
// HTML entry point
'index': grunt.file.read(path.resolve(srcPath, "index.html")),
// Static files mappage
"static": {
"octicons": path.resolve(srcPath, "vendors/octicons/octicons"),
"images": path.resolve(srcPath, "resources/images"),
},
// Stylesheet entry point
"style": path.resolve(srcPath, "resources/stylesheets/main.less"),
// Modules paths
'paths': {
'rickshaw': "vendors/rickshaw/rickshaw",
'd3': "vendors/d3/d3",
"datamaps": "vendors/datamaps/dist/datamaps.world",
"topojson": "vendors/topojson/topojson",
"moment": "vendors/moment/moment"
},
"shim": {
"main": {
"deps": [
'hr/dom',
'vendors/bootstrap/js/carousel',
'vendors/bootstrap/js/dropdown',
'vendors/bootstrap/js/button',
'vendors/bootstrap/js/modal',
'vendors/bootstrap/js/affix',
'vendors/bootstrap/js/alert',
'vendors/bootstrap/js/collapse',
'vendors/bootstrap/js/tooltip',
'vendors/bootstrap/js/popover',
'vendors/bootstrap/js/scrollspy',
'vendors/bootstrap/js/tab',
'vendors/bootstrap/js/transition'
]
},
"rickshaw": {
"exports": "Rickshaw",
"deps": [
'd3'
]
},
"d3": {
"exports": "d3"
},
"datamaps": {
"deps": [
"topojson"
]
}
},
'args': {},
'options': {}
}
}
});
// Prepare build
grunt.registerTask("prepare", [
"bower-install-simple"
]);
// Build
grunt.registerTask('build', [
'hr:app'
]);
grunt.registerTask('default', [
'prepare',
'build'
]);
};