You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.2 KiB

  1. /*
  2. * grunt-contrib-less
  3. * http://gruntjs.com/
  4. *
  5. * Copyright (c) 2012 Tyler Kellen, contributors
  6. * Licensed under the MIT license.
  7. */
  8. 'use strict';
  9. module.exports = function(grunt) {
  10. // Project configuration.
  11. grunt.initConfig({
  12. jshint: {
  13. all: [
  14. 'Gruntfile.js',
  15. 'tasks/*.js',
  16. '<%= nodeunit.tests %>'
  17. ],
  18. options: {
  19. jshintrc: '.jshintrc'
  20. }
  21. },
  22. // Before generating any new files, remove any previously-created files.
  23. clean: {
  24. tests: ['tmp']
  25. },
  26. // Configuration to be run (and then tested).
  27. less: {
  28. compile: {
  29. options: {
  30. paths: ['test/fixtures/include']
  31. },
  32. files: {
  33. 'tmp/less.css': ['test/fixtures/style.less'],
  34. 'tmp/concat.css': ['test/fixtures/style.less', 'test/fixtures/style2.less']
  35. }
  36. },
  37. compress: {
  38. options: {
  39. paths: ['test/fixtures/include'],
  40. compress: true
  41. },
  42. files: {
  43. 'tmp/compress.css': ['test/fixtures/style.less']
  44. }
  45. },
  46. nopaths: {
  47. files: {
  48. 'tmp/nopaths.css': ['test/fixtures/nopaths.less']
  49. }
  50. },
  51. yuicompress: {
  52. options: {
  53. paths: ['test/fixtures/include'],
  54. yuicompress: true
  55. },
  56. files: {
  57. 'tmp/yuicompress.css': ['test/fixtures/style.less']
  58. }
  59. },
  60. nofiles: {
  61. },
  62. nomatchedfiles: {
  63. files: { "tmp/nomatchedfiles.css" : 'test/nonexistent/*.less' }
  64. }
  65. },
  66. // Unit tests.
  67. nodeunit: {
  68. tests: ['test/*_test.js']
  69. }
  70. });
  71. // Actually load this plugin's task(s).
  72. grunt.loadTasks('tasks');
  73. // These plugins provide necessary tasks.
  74. grunt.loadNpmTasks('grunt-contrib-jshint');
  75. grunt.loadNpmTasks('grunt-contrib-clean');
  76. grunt.loadNpmTasks('grunt-contrib-nodeunit');
  77. grunt.loadNpmTasks('grunt-contrib-internal');
  78. // Whenever the "test" task is run, first clean the "tmp" dir, then run this
  79. // plugin's task(s), then test the result.
  80. grunt.registerTask('test', ['clean', 'less', 'nodeunit']);
  81. // By default, lint and run all tests.
  82. grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);
  83. };