build_task.js 848 B

12345678910111213141516171819202122232425262728293031323334353637
  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. 'clean:on_start',
  7. 'less:src',
  8. 'concat:css',
  9. 'copy:everything_but_less_to_temp',
  10. 'htmlmin:build',
  11. 'ngtemplates',
  12. 'cssmin:build',
  13. 'build:grafanaVersion',
  14. 'ngmin:build',
  15. 'requirejs:build',
  16. 'concat:js',
  17. 'filerev',
  18. 'usemin',
  19. 'clean:temp',
  20. 'uglify:dest'
  21. ]);
  22. grunt.registerTask('build:grafanaVersion', function() {
  23. grunt.config('string-replace.config', {
  24. files: {
  25. '<%= tempDir %>/app/app.js': '<%= tempDir %>/app/app.js'
  26. },
  27. options: {
  28. replacements: [{ pattern: /@grafanaVersion@/g, replacement: '<%= pkg.version %>' }]
  29. }
  30. });
  31. grunt.task.run('string-replace:config');
  32. });
  33. };