Gruntfile.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. 'use strict';
  2. module.exports = function (grunt) {
  3. // load all grunt tasks
  4. grunt.loadNpmTasks('grunt-contrib-less');
  5. grunt.loadNpmTasks('grunt-contrib-watch');
  6. grunt.initConfig({
  7. watch: {
  8. // if any .less file changes in directory "build/less/" run the "less"-task.
  9. files: ["build/less/*.less", "build/less/skins/*.less"],
  10. tasks: ["less"]
  11. },
  12. // "less"-task configuration
  13. less: {
  14. //Development not compressed
  15. development: {
  16. options: {
  17. // Specifies directories to scan for @import directives when parsing.
  18. // Default value is the directory of the source, which is probably what you want.
  19. paths: ["dist/css/"],
  20. compress: false
  21. },
  22. files: {
  23. // compilation.css : source.less
  24. "dist/css/AdminLTE.css": "build/less/AdminLTE.less"
  25. }
  26. },
  27. //production compresses version
  28. production: {
  29. options: {
  30. // Specifies directories to scan for @import directives when parsing.
  31. // Default value is the directory of the source, which is probably what you want.
  32. paths: ["dist/css/"],
  33. compress: true
  34. },
  35. files: {
  36. // compilation.css : source.less
  37. "dist/css/AdminLTE.min.css": "build/less/AdminLTE.less"
  38. }
  39. }
  40. }
  41. });
  42. // the default task (running "grunt" in console) is "watch"
  43. grunt.registerTask('default', ['watch']);
  44. };