Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding import rules (maybe through plugins) #1697

Closed
donaldpipowitch opened this issue Dec 2, 2013 · 8 comments
Closed

Allow overriding import rules (maybe through plugins) #1697

donaldpipowitch opened this issue Dec 2, 2013 · 8 comments

Comments

@donaldpipowitch
Copy link

@donaldpipowitch donaldpipowitch commented Dec 2, 2013

Rework has a nice plugin architecture which makes it possible to create plugins like Rework NPM. This plugin allows importing of CSS with Node-require-like logic (see here).

I want to do a similar thing with Bower packages for Less.

Example:
In Less I can import a .less file from a bower_component like this:

@import "../bower_components/mixins-lib/actual-less-file";

I can also add the path to ../bower_components in the build step so I can write this:

@import "mixins-lib/actual-less-file";

But what I really want is this:

@import "mixins-lib";

Hence the mixins-lib/ Bower package has declared the actual-less-file.less in bower.json's main property I can import actual-less-file via the Bower package name.

@lukeapage
Copy link
Member

@lukeapage lukeapage commented Dec 22, 2013

I'd support making the import process more pluggable. Are you planning on submitting a patch?

@donaldpipowitch
Copy link
Author

@donaldpipowitch donaldpipowitch commented Dec 23, 2013

I haven't planned to do that - probably I don't have enough time for this anytime soon :( -, but if I would start that I would ask if this should be a more generic question about adding plugins for less - not just for imports?

@ghost ghost assigned cloudhead Dec 23, 2013
@lukeapage
Copy link
Member

@lukeapage lukeapage commented Dec 23, 2013

I recently added plugins to less, but at the moment they are visitors running on the ast. I've yet to document them..

@donaldpipowitch
Copy link
Author

@donaldpipowitch donaldpipowitch commented Dec 23, 2013

Sounds great! If you finish the docs, please drop a link :)

@matthew-dean
Copy link
Member

@matthew-dean matthew-dean commented Dec 24, 2013

I recently added plugins to less

Wait, what? Weren't plugins already possible (just not auto-loadable)?

@matthew-dean
Copy link
Member

@matthew-dean matthew-dean commented Dec 24, 2013

(suddenly very interested in said documentation)

@donaldpipowitch
Copy link
Author

@donaldpipowitch donaldpipowitch commented Jan 27, 2014

Hi @lukeapage, can I find the docs about plugins somewhere on the new docs page? Or could you point me to the file changes including the plugin architecture? Thank you!

@donaldpipowitch
Copy link
Author

@donaldpipowitch donaldpipowitch commented Oct 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.