Gruntfile.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. * Grunt tasks for Toolbar Themes.
  3. * http://gruntjs.com/
  4. */
  5. 'use strict';
  6. module.exports = function(grunt) {
  7. grunt.initConfig({
  8. pkg: grunt.file.readJSON('package.json'),
  9. sass: {
  10. styles: {
  11. files: [{
  12. expand: true,
  13. cwd: 'themes',
  14. src: ['**/*.scss'],
  15. dest: 'themes',
  16. ext: '.css'
  17. }],
  18. options: {
  19. precision: 5,
  20. outputStyle: 'expanded',
  21. sourceMap: true
  22. }
  23. }
  24. },
  25. grunticon: {
  26. toolbar: {
  27. files: [{
  28. expand: true,
  29. cwd: 'themes/base/grunticons/original',
  30. src: ['*.svg'],
  31. dest: 'themes/base/grunticons/processed'
  32. }],
  33. options: {
  34. enhanceSVG: true,
  35. cssprefix: '.'
  36. }
  37. }
  38. },
  39. postcss: {
  40. styles: {
  41. src: 'themes/**/*.css',
  42. options: {
  43. map: {
  44. inline: false
  45. },
  46. processors: [
  47. require('autoprefixer')({browsers: 'last 4 versions'})
  48. ]
  49. }
  50. }
  51. },
  52. watch: {
  53. styles: {
  54. files: 'themes/**/*.scss',
  55. tasks: ['sass:styles', 'postcss:styles']
  56. }
  57. }
  58. });
  59. grunt.loadNpmTasks('grunt-postcss');
  60. grunt.loadNpmTasks('grunt-sass');
  61. grunt.loadNpmTasks('grunt-grunticon');
  62. grunt.loadNpmTasks('grunt-contrib-watch');
  63. grunt.registerTask('default', ['watch:styles']);
  64. };