Last active
August 29, 2015 14:16
-
-
Save zxqx/3e191f4f73382fdfdf45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
module.exports = function(grunt) | |
{ | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.registerTask('client-compile-sass', function() { | |
// This is set via the Gruntfile with grunt.config | |
var brands = grunt.config.get('brands'); | |
var sassMappings = _setupSassMappings(brands); | |
grunt.config('sass', { | |
options: { | |
sourcemap: 'none' | |
}, | |
dist: { | |
files: sassMappings | |
} | |
}); | |
grunt.task.run('sass'); | |
}); | |
} | |
/** | |
* @private | |
* @param {Array} brands | |
*/ | |
function _setupSassMappings(brands) | |
{ | |
var sassMappings = {}; | |
brands.forEach(function(brand) { | |
var dest = path.join('dist', brand, 'css/main.min.css'); | |
var src = path.join('src/styles', brand, 'default.scss'); | |
sassMappings[dest] = src; | |
}); | |
return sassMappings; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment