Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. module.exports = function (grunt) {
  2. var jsFiles = [
  3. 'public/app/services/*.js',
  4. 'public/app/directives/*.js',
  5. 'public/app/controllers/*.js'
  6.  
  7. ];
  8.  
  9. grunt.initConfig({
  10. pkg: grunt.file.readJSON('package.json'),
  11.  
  12. uglify: {
  13. options: {
  14. banner: '/*\n <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> \n*/\n'
  15. },
  16. build: {
  17. files: {
  18. 'public/build/script.min.js': jsFiles
  19. }
  20. }
  21. },
  22.  
  23. concat: {
  24. options: {
  25. separator: '\n;\n\n'
  26. },
  27. dist: {
  28. src: ["public/vendor/jquery/dist/jquery.min.js",
  29. "public/vendor/bootstrap/dist/js/bootstrap.min.js",
  30. "public/vendor/angular/angular.min.js",
  31. "public/vendor/ui-bootstrap-custom-build/ui-bootstrap-custom-tpls-1.1.1.js",
  32. "public/vendor/ui-bootstrap-custom-build/ui-bootstrap-custom-1.1.1.js",
  33. "public/vendor/angular-ui-router/release/angular-ui-router.min.js",
  34. "public/vendor/toastr/toastr.min.js",
  35. "public/vendor/ngstorage/ngStorage.min.js",
  36. "public/vendor/angular-ui-switch/angular-ui-switch.min.js",
  37. "public/vendor/underscore/underscore.js"
  38. ],
  39. dest: 'public/build/all.js'
  40. }
  41. },
  42. jshint: {
  43. beforeconcat: jsFiles,
  44. afterconcat: ['public/build/script.min.js']
  45. },
  46. watch: {
  47. scripts: {
  48. files: jsFiles,
  49. tasks: ['uglify'],
  50. options: {
  51. spawn: false,
  52. },
  53. },
  54. },
  55. cssmin: {
  56. options: {
  57. shorthandCompacting: false,
  58. roundingPrecision: -1
  59. },
  60. target: {
  61. files: {
  62. 'public/build/all.min.css': [
  63. 'public/css/bootstrap.css',
  64. 'public/css/bootstrap-toggle.min.css',
  65. 'public/css/custom.css',
  66. 'public/css/font-awesome.min.css',
  67. "public/vendor/ui-bootstrap-custom-build/ui-bootstrap-custom-1.1.1-csp.css"
  68. ]
  69. }
  70. }
  71. }
  72. });
  73.  
  74. grunt.loadNpmTasks('grunt-contrib-jshint');
  75. grunt.loadNpmTasks("grunt-contrib-uglify");
  76. grunt.loadNpmTasks('grunt-contrib-concat');
  77. grunt.loadNpmTasks('grunt-contrib-cssmin');
  78. grunt.loadNpmTasks('grunt-contrib-watch');
  79. grunt.registerTask('default', ['jshint',/* 'uglify',*/ 'concat', 'cssmin', 'watch']);
  80. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement