Gruntfile.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. module.exports = function (grunt) {
  2. grunt.initConfig({
  3. watch: {
  4. compass: {
  5. files: ['scss/styles.scss', 'scss/wysiwyg.scss'],
  6. tasks: ['compass:dev']
  7. },
  8. postcss: {
  9. files: ['scss/styles.scss', 'scss/wysiwyg.scss'],
  10. tasks: ['postcss']
  11. },
  12. // options: {
  13. // livereload: true,
  14. // },
  15. },
  16. compass: {
  17. dev: {
  18. options: {
  19. sassDir: 'scss',
  20. cssDir: 'css',
  21. specify: ['scss/styles.scss', 'scss/wysiwyg.scss'],
  22. imagesPath: 'img',
  23. noLineComments: false,
  24. // outputStyle: 'compressed'
  25. }
  26. }
  27. },
  28. postcss: {
  29. options: {
  30. processors: [
  31. require('autoprefixer-core')({
  32. browsers: ['> 1%'] //, 'ie 8', 'ie 7', 'FirefoxAndroid', 'ExplorerMobile', 'ChromeAndroid'
  33. }).postcss,
  34. ]
  35. },
  36. dist: { src: 'css/*.css' }
  37. },
  38. svg2png: {
  39. assets: {
  40. // specify files in array format with multiple src-dest mapping
  41. files: [
  42. // rasterize all SVG files in "img" and its subdirectories to "img/png"
  43. // { src: ['assets/img/*.svg'], dest: 'assets/img/png/' },
  44. // rasterize SVG file to same directory
  45. { src: ['img/*.svg'] }
  46. ]
  47. }
  48. }
  49. });
  50. grunt.loadNpmTasks('grunt-contrib-compass');
  51. grunt.loadNpmTasks('grunt-contrib-sass');
  52. grunt.loadNpmTasks('grunt-contrib-watch');
  53. grunt.loadNpmTasks('grunt-postcss');
  54. grunt.loadNpmTasks('grunt-svg2png');
  55. grunt.registerTask('default', ['svg2png']);
  56. };