Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. module.exports = function(grunt) {
  2. "use strict";
  3.  
  4. var theme_name = 'f5';
  5.  
  6. var global_vars = {
  7. theme_name: theme_name,
  8. theme_css: 'css',
  9. theme_scss: 'scss'
  10. }
  11.  
  12. grunt.initConfig({
  13. global_vars: global_vars,
  14. pkg: grunt.file.readJSON('package.json'),
  15.  
  16. sass: {
  17. options: {
  18. outputStyle: 'compressed',
  19. sourceMap: true,
  20. includePaths: ['<%= global_vars.theme_scss %>', '<%= global_vars.theme_scss %>/vendor', require('node-bourbon').includePaths]
  21. },
  22. dist: {
  23. files: {
  24. '<%= global_vars.theme_css %>/<%= global_vars.theme_name %>.css': '<%= global_vars.theme_scss %>/<%= global_vars.theme_name %>.scss'
  25. }
  26. },
  27. dist_custom: {
  28. files: grunt.file.expandMapping(['scss/extra/*.scss'], 'css/', {
  29. rename: function (dest, matched) {
  30. return matched.replace(/scss/g, 'css');
  31. }
  32. })
  33. }
  34. },
  35.  
  36. copy: {
  37. dist: {
  38. files: [
  39. {
  40. expand:true,
  41. cwd: 'bower_components/foundation/js',
  42. src: ['foundation/*.js'], dest: 'js/', filter: 'isFile'
  43. },
  44. {
  45. expand:true,
  46. cwd: 'bower_components/foundation/',
  47. src: ['foundation.min.js'],
  48. dest: 'js/',
  49. filter: 'isFile'
  50. },
  51. {
  52. expand:true,
  53. cwd: 'bower_components/foundation/js/vendor',
  54. src: ['*.js'],
  55. dest: 'js/vendor',
  56. filter: 'isFile'
  57. },
  58. {
  59. expand:true,
  60. cwd: 'bower_components/foundation/scss/foundation',
  61. src: ['**/*.scss'],
  62. dest: 'scss/vendor/foundation',
  63. filter: 'isFile'
  64. },
  65. {
  66. expand:true,
  67. cwd: 'bower_components/foundation/scss',
  68. src: ['*.scss'],
  69. dest: 'scss/vendor/foundation',
  70. filter: 'isFile'
  71. }
  72. ]
  73. }
  74. },
  75.  
  76. watch: {
  77. grunt: { files: ['Gruntfile.js'] },
  78.  
  79. sass: {
  80. files: '<%= global_vars.theme_scss %>/**/*.scss',
  81. tasks: ['sass'],
  82. options: {
  83. livereload: true
  84. }
  85. }
  86. },
  87.  
  88. sass_globbing: {
  89. foundation: {
  90. files: {
  91. 'scss/extra/_importMap.scss': 'scss/vendor/foundation/components/*.scss',
  92. }
  93. }
  94. },
  95.  
  96. clean: {
  97. js: [
  98. "scss/vendor/foundation/**/*.scss",
  99. "!scss/vendor/foundation/_variables.scss",
  100. "js/vendor/*"
  101. ]
  102. }
  103. });
  104.  
  105. grunt.loadNpmTasks('grunt-sass');
  106. grunt.loadNpmTasks('grunt-contrib-copy');
  107. grunt.loadNpmTasks('grunt-contrib-watch');
  108. grunt.loadNpmTasks('grunt-sass-globbing');
  109. grunt.loadNpmTasks('grunt-contrib-clean');
  110.  
  111. grunt.registerTask('erase', ['clean']);
  112. grunt.registerTask('assemble', ['sass_globbing']);
  113. grunt.registerTask('build', ['erase', 'copy', 'sass_globbing', 'sass']);
  114. grunt.registerTask('default', ['build', 'watch']);
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement