Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Passing options, such as paths, to importer #135

Open
jasonmit opened this issue Jul 28, 2015 · 3 comments
Open

Passing options, such as paths, to importer #135

jasonmit opened this issue Jul 28, 2015 · 3 comments

Comments

@jasonmit
Copy link

Is it within the scope of the project to permit passing options, such as path to importer?

For example:

// reduced for brevit
// options.paths = ['/home/jasonmit/project', '/home/jasonmit/project/styles/app.css']
exports.import = function(options){
  return importer({
    path: options.paths
  })
};

https://github.com/segmentio/myth/blob/master/lib/features.js#L26

Would permit:

// project/styles/app.css
@import 'bower_components/foo/bar/baz.css';

Right now I need to use relative paths everywhere for imports outside of the source directory to be importable. I thought this was what the paths option was for, but then noticed it never gets passed to the importer.

// project/styles/app.css
@import '../../bower_components/foo/bar/baz.css';
@ianstormtaylor
Copy link
Contributor

Totally! We actually do it for other options already. We'd just need to come up with a name, although path sounds good to me.

Edit: although if it's an array of paths then plural

@jasonmit
Copy link
Author

Okay, I'll send a PR tonight tomorrow 👍

@jasonmit
Copy link
Author

jasonmit commented Aug 5, 2015

@ianstormtaylor PR opened if you can take a look and provide feedback. Thanks :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants