Skip to content

Instantly share code, notes, and snippets.

@zxqx
Last active August 29, 2015 14:16
Show Gist options
  • Save zxqx/3e191f4f73382fdfdf45 to your computer and use it in GitHub Desktop.
Save zxqx/3e191f4f73382fdfdf45 to your computer and use it in GitHub Desktop.
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