quaertym / ember-cli-compass-compiler

Ember CLI Compass Compiler
MIT License
28 stars 23 forks source link

How to override the default options? #2

Closed nightire closed 10 years ago

nightire commented 10 years ago

Can you provide an example to override the default options, say what if I need to require more compass plugins?

nightire commented 10 years ago

Finally I figure this out by myself, in case of someone needs help, I put my solution at here:

Open Brocfile.js and find this line:

var app = new EmberApp();

then, change it to:

var app = new EmberApp({
  compassOptions: {
    require: ['sass-css-importer', 'susy']
  }
});

this assumes you want to use Susy as well as me, and of course you can override other options like above.

BTW, if you use sass syntax checker, e.g. syntastic in vim, @import "susy"; will rise an error about load path problem. Before using Ember-CLI, I use a config.rb as compass's configurations, so sass knows about require "susy" is a dependency should be concerned about. But now we no longer have config.rb file anymore, fortunately you can let sass knows required gem(s) by passing -r GEM_NAME to passing the syntax checker. For case of syntastic, you can simply put this line in your .vimrc file:

let g:syntastic_scss_sass_args = "-r sass-css-importer -r susy"
quaertym commented 10 years ago

You can override default options doing the following in your Brocfile:

var app = new EmberApp({
  compassOptions: {
    require: ['sass-css-importer', 'susy']
  }
});

I will add that to the README as well.

@nightire does this work for you?

quaertym commented 10 years ago

I think we can close this for now.