I would like to be able to use compass to pre-process my SASS into CSS in an ember-cli project.
Doing this with broccoli-sass
is trivial, as bower install broccoli-sass
is all that is required, as the support for it is already built in.
Doing this with broccoli-compass
however, has turned out to be rather tricky... how?
Details:
This question has been asked previously, for ember-cli v0.0.23;
and it's answer appears to be outdated -
The main issue appears to be that ember-cli abstracts a lot of the stuff inBrocfile.js
, and puts it into another file, preprocessor.js
, using a Registry
, and thus the solution would be different, to a standard looking Brocfile.js
Update:
This question has been asnwered by @saygun, and the solution allows one to use broccoli-compass to compile SCSS --> CSS. However there are a couple of caveats:
- Minor issue: The existing
minifyCss
preprocessor in meber-cli will not work. You will need to configure compass to minify its own CSS. - Major issue: If the SCSS files reference images, the generated CSS files contain links to images where the paths are within the temporary tree folders created by Broccoli. I am not sure how to work around this, and have asked a follow up question: How to generate image sprites in ember-cli using compass?
node_modules/ember-cli/lib/preprocessors.js
, and I found thisRegistry
system. I tried to add the a new function to that (modules.exports.preprocessCompass = function...
), but just got a some rather cryptic stack traces... so not very far. I'm about to try @saygun 's suggestion below. – bguizbroccoli-compass
, and was about adding the ability to configure any broccoli plugin in the mainBrocfile.js
and have it integrate well with the built in ones inpreprocessors.js
. – bguiz