joliss / broccoli-sass

Sass compiler for Broccoli, using libsass
MIT License
44 stars 97 forks source link

glob as inputFile #25

Closed SamHasler closed 9 years ago

SamHasler commented 10 years ago

Is there a way to do globbing with broccoli to pass multiple main.scss files to compileSass?

e.g. theme*\sass\*.scss -> theme*\css\*.css

(My use case is that we have multiple themes, each with their own main.scss, that each import several _module.scss files)

simonexmachina commented 10 years ago

Yes, the way is JavaScript and broccoli-merge-trees ;) Something along the lines of:

var trees = _.map(glob.sync('theme*/sass/main.scss', function(sassFile) {
  return compileSass(inputTrees, sassFile, sassFile.replace(/.scss$/, '.css');
}));
return mergeTrees(trees);
SamHasler commented 10 years ago

That's exactly what I needed :joy:, thanks!

rwjblue commented 10 years ago

@joliss - Looks like this was answered, seems like it can be closed.