build_task.js 898 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. module.exports = function(grunt) {
  2. // Concat and Minify the src directory into dist
  3. grunt.registerTask('build', [
  4. 'jshint:source',
  5. 'jshint:tests',
  6. 'karma:test',
  7. 'clean:on_start',
  8. 'less:src',
  9. 'concat:cssDark',
  10. 'concat:cssLight',
  11. 'copy:everything_but_less_to_temp',
  12. 'htmlmin:build',
  13. 'ngtemplates',
  14. 'cssmin:build',
  15. 'build:grafanaVersion',
  16. 'ngAnnotate:build',
  17. 'requirejs:build',
  18. 'concat:js',
  19. 'filerev',
  20. 'usemin',
  21. 'clean:temp',
  22. 'uglify:dest'
  23. ]);
  24. grunt.registerTask('build:grafanaVersion', function() {
  25. grunt.config('string-replace.config', {
  26. files: {
  27. '<%= tempDir %>/app/app.js': '<%= tempDir %>/app/app.js'
  28. },
  29. options: {
  30. replacements: [{ pattern: /@grafanaVersion@/g, replacement: '<%= pkg.version %>' }]
  31. }
  32. });
  33. grunt.task.run('string-replace:config');
  34. });
  35. };