brunch / stylus-brunch

Adds Stylus support to Brunch
MIT License
21 stars 2 forks source link

Add the ability add paths to stylus compiler #3

Closed destos closed 12 years ago

destos commented 12 years ago

I need to import stylus files that are outside the brunch config folder but am running into some issues.

My use case is a bunch of individual apps that will share stylus styles that need to be individually built and would like to avoid stylus includes like @import '../../../stylus/forms'.

I figured one would need to use stylus().set('paths', paths) per the stylus docs, and attempted this:

  compile: (data, path, callback) =>
    stylus(data)
      .set('compress', no)
      .set('firebug', !!@config.stylus?.firebug)
      .set('paths', @config.stylus?.paths)
      .include(sysPath.join @config.paths.root)
      .include(sysPath.dirname path)
      .use(nib())
      .render(callback)

Which would look something like stylus.paths: [ '/my/absolude/imaginary/path/stylus']in the config.coffee

However didn't have much luck.

paulmillr commented 12 years ago

it should work. how about using include for each config.stylus.paths?

destos commented 12 years ago

This appears to have added the functionality I need: 6d59081d25825949dc6ba64611c40d4d31cd4c87

Let me know if you want me to write tests before a pull request.

paulmillr commented 12 years ago

yep, tests would be nice