Gruntfile.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * grunt-contrib-sass
  3. * http://gruntjs.com/
  4. *
  5. * Copyright (c) 2012 Sindre Sorhus, contributors
  6. * Licensed under the MIT license.
  7. */
  8. 'use strict';
  9. module.exports = function (grunt) {
  10. grunt.initConfig({
  11. pkg: {
  12. name: 'grunt-contrib-sass'
  13. },
  14. jshint: {
  15. options: {
  16. jshintrc: '.jshintrc'
  17. },
  18. all: [
  19. 'Gruntfile.js',
  20. 'tasks/*.js',
  21. '<%= nodeunit.tests %>'
  22. ]
  23. },
  24. clean: {
  25. test: [
  26. 'test/tmp',
  27. '.sass-cache'
  28. ]
  29. },
  30. nodeunit: {
  31. tests: ['test/*_test.js']
  32. },
  33. sass: {
  34. options: {
  35. //debugInfo: true,
  36. // style: 'expanded'
  37. },
  38. compile: {
  39. files: {
  40. 'test/tmp/scss.css': ['test/fixtures/compile.scss'],
  41. 'test/tmp/sass.css': ['test/fixtures/compile.sass'],
  42. 'test/tmp/css.css': ['test/fixtures/compile.css']
  43. }
  44. },
  45. compileBanner: {
  46. options: {
  47. banner: '/* <%= pkg.name %> banner */'
  48. },
  49. files: {
  50. 'test/tmp/scss-banner.css': ['test/fixtures/banner.scss'],
  51. 'test/tmp/sass-banner.css': ['test/fixtures/banner.sass'],
  52. 'test/tmp/css-banner.css': ['test/fixtures/banner.css']
  53. }
  54. },
  55. ignorePartials: {
  56. cwd: 'test/fixtures/partials',
  57. src: '*.scss',
  58. dest: 'test/tmp',
  59. expand: true,
  60. ext: '.css'
  61. }
  62. }
  63. });
  64. grunt.loadTasks('tasks');
  65. grunt.loadNpmTasks('grunt-contrib-clean');
  66. grunt.loadNpmTasks('grunt-contrib-jshint');
  67. grunt.loadNpmTasks('grunt-contrib-nodeunit');
  68. grunt.loadNpmTasks('grunt-contrib-internal');
  69. grunt.registerTask('mkdir', grunt.file.mkdir);
  70. grunt.registerTask('test', [
  71. 'clean',
  72. 'mkdir:tmp',
  73. 'sass',
  74. 'nodeunit',
  75. 'clean'
  76. ]);
  77. grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);
  78. };