Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function(grunt) {
- "use strict";
- var theme_name = 'f5';
- var global_vars = {
- theme_name: theme_name,
- theme_css: 'css',
- theme_scss: 'scss'
- }
- grunt.initConfig({
- global_vars: global_vars,
- pkg: grunt.file.readJSON('package.json'),
- sass: {
- options: {
- outputStyle: 'compressed',
- sourceMap: true,
- includePaths: ['<%= global_vars.theme_scss %>', '<%= global_vars.theme_scss %>/vendor', require('node-bourbon').includePaths]
- },
- dist: {
- files: {
- '<%= global_vars.theme_css %>/<%= global_vars.theme_name %>.css': '<%= global_vars.theme_scss %>/<%= global_vars.theme_name %>.scss'
- }
- },
- dist_custom: {
- files: grunt.file.expandMapping(['scss/extra/*.scss'], 'css/', {
- rename: function (dest, matched) {
- return matched.replace(/scss/g, 'css');
- }
- })
- }
- },
- copy: {
- dist: {
- files: [
- {
- expand:true,
- cwd: 'bower_components/foundation/js',
- src: ['foundation/*.js'], dest: 'js/', filter: 'isFile'
- },
- {
- expand:true,
- cwd: 'bower_components/foundation/',
- src: ['foundation.min.js'],
- dest: 'js/',
- filter: 'isFile'
- },
- {
- expand:true,
- cwd: 'bower_components/foundation/js/vendor',
- src: ['*.js'],
- dest: 'js/vendor',
- filter: 'isFile'
- },
- {
- expand:true,
- cwd: 'bower_components/foundation/scss/foundation',
- src: ['**/*.scss'],
- dest: 'scss/vendor/foundation',
- filter: 'isFile'
- },
- {
- expand:true,
- cwd: 'bower_components/foundation/scss',
- src: ['*.scss'],
- dest: 'scss/vendor/foundation',
- filter: 'isFile'
- }
- ]
- }
- },
- watch: {
- grunt: { files: ['Gruntfile.js'] },
- sass: {
- files: '<%= global_vars.theme_scss %>/**/*.scss',
- tasks: ['sass'],
- options: {
- livereload: true
- }
- }
- },
- sass_globbing: {
- foundation: {
- files: {
- 'scss/extra/_importMap.scss': 'scss/vendor/foundation/components/*.scss',
- }
- }
- },
- clean: {
- js: [
- "scss/vendor/foundation/**/*.scss",
- "!scss/vendor/foundation/_variables.scss",
- "js/vendor/*"
- ]
- }
- });
- grunt.loadNpmTasks('grunt-sass');
- grunt.loadNpmTasks('grunt-contrib-copy');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-sass-globbing');
- grunt.loadNpmTasks('grunt-contrib-clean');
- grunt.registerTask('erase', ['clean']);
- grunt.registerTask('assemble', ['sass_globbing']);
- grunt.registerTask('build', ['erase', 'copy', 'sass_globbing', 'sass']);
- grunt.registerTask('default', ['build', 'watch']);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement