forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_task.js
38 lines (34 loc) · 875 Bytes
/
build_task.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
module.exports = function(grunt) {
// Concat and Minify the src directory into dist
grunt.registerTask('build', [
'jshint:source',
'jshint:tests',
'clean:on_start',
'less:src',
'concat:cssDark',
'concat:cssLight',
'copy:everything_but_less_to_temp',
'htmlmin:build',
'ngtemplates',
'cssmin:build',
'build:grafanaVersion',
'ngmin:build',
'requirejs:build',
'concat:js',
'filerev',
'usemin',
'clean:temp',
'uglify:dest'
]);
grunt.registerTask('build:grafanaVersion', function() {
grunt.config('string-replace.config', {
files: {
'<%= tempDir %>/app/app.js': '<%= tempDir %>/app/app.js'
},
options: {
replacements: [{ pattern: /@grafanaVersion@/g, replacement: '<%= pkg.version %>' }]
}
});
grunt.task.run('string-replace:config');
});
};