Gruntfile.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. // bundleExec: true
  38. },
  39. compile: {
  40. files: {
  41. 'test/tmp/scss.css': ['test/fixtures/compile.scss'],
  42. 'test/tmp/sass.css': ['test/fixtures/compile.sass'],
  43. 'test/tmp/css.css': ['test/fixtures/compile.css']
  44. }
  45. },
  46. compileBanner: {
  47. options: {
  48. banner: '/* <%= pkg.name %> banner */'
  49. },
  50. files: {
  51. 'test/tmp/scss-banner.css': ['test/fixtures/banner.scss'],
  52. 'test/tmp/sass-banner.css': ['test/fixtures/banner.sass'],
  53. 'test/tmp/css-banner.css': ['test/fixtures/banner.css']
  54. }
  55. },
  56. ignorePartials: {
  57. cwd: 'test/fixtures/partials',
  58. src: '*.scss',
  59. dest: 'test/tmp',
  60. expand: true,
  61. ext: '.css'
  62. }
  63. }
  64. });
  65. grunt.loadTasks('tasks');
  66. grunt.loadNpmTasks('grunt-contrib-clean');
  67. grunt.loadNpmTasks('grunt-contrib-jshint');
  68. grunt.loadNpmTasks('grunt-contrib-nodeunit');
  69. grunt.loadNpmTasks('grunt-contrib-internal');
  70. grunt.registerTask('mkdir', grunt.file.mkdir);
  71. grunt.registerTask('test', [
  72. 'clean',
  73. 'mkdir:tmp',
  74. 'sass',
  75. 'nodeunit',
  76. 'clean'
  77. ]);
  78. grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);
  79. };