Skip to content

Instantly share code, notes, and snippets.

@abrjagad
Created April 22, 2016 09:17
Show Gist options
  • Save abrjagad/3359c602c5d3045059165f5055dcf33c to your computer and use it in GitHub Desktop.
Save abrjagad/3359c602c5d3045059165f5055dcf33c to your computer and use it in GitHub Desktop.
var f = ['women','men'];
var context = require.context('./', true, /.scss$/);
var module = context.keys();
module.sort(function(a,b){
return (f.indexOf(a.split('/')[1])>f.indexOf(b.split('/')[1]))
});
console.log(module);
//module.forEach(context)
//// execute them
module.forEach(function(key) {
context(key);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment