grafana/tasks/build_task.js

38 lines
848 B
JavaScript
Raw Normal View History

2013-11-15 07:07:14 +08:00
module.exports = function(grunt) {
// Concat and Minify the src directory into dist
grunt.registerTask('build', [
'jshint:source',
'jshint:tests',
2013-11-15 07:07:14 +08:00
'clean:on_start',
2014-02-11 01:05:52 +08:00
'less:src',
'concat:css',
2013-11-15 07:07:14 +08:00
'copy:everything_but_less_to_temp',
'htmlmin:build',
'ngtemplates',
2013-11-15 07:07:14 +08:00
'cssmin:build',
'build:grafanaVersion',
2013-11-15 07:07:14 +08:00
'ngmin:build',
'requirejs:build',
'concat:js',
'filerev',
'usemin',
2013-11-15 07:07:14 +08:00
'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 %>' }]
}
2013-11-15 07:07:14 +08:00
});
grunt.task.run('string-replace:config');
2013-11-15 07:07:14 +08:00
});
};