Gruntfile.js 1.6 KB

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