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

Support '*' wildcard for @import #1447

Closed
luk3thomas opened this issue Jul 25, 2013 · 12 comments
Closed

Support '*' wildcard for @import #1447

luk3thomas opened this issue Jul 25, 2013 · 12 comments

Comments

@luk3thomas
Copy link

It would be nice if less.js supported wildcards for the @import function. For example:

Directory structure:

.
├── main.less
└── some
    └── dir
        ├── a.less
        ├── b.less
        └── c.less

Then in main.less I can import all the files inside some/dir:

@import 'some/dir/*'

If this feature is relevant and worth considering I'm happy to submit a PR. Let me know what you think. Thanks!

@jonschlinkert
Copy link
Contributor

duplicate of #1181

@lukeapage
Copy link
Member

P.s a pr would be great.. we welcome contributions.. please add a comment
if you want help and do the request against the 1.5.0 branch.

@jonschlinkert
Copy link
Contributor

I just now noticed that you' offered to do a PR. That would be great, what lib(s) are you thinking of using? How would you do this to account for node.js vs browser etc.?

@luk3thomas
Copy link
Author

I'm not sure how I would implement the feature in the browser. Do you have any thoughts @jonschlinkert?

@jonschlinkert
Copy link
Contributor

No thoughts on it lol, I was hoping you did. The general consensus has been that only node.js should be supported, but who knows I thought maybe you had some ideas for how it would work in the browser and I didn't want to discourage it prematurely.

What about dependencies? Minimatch?

@cowboy, I noticed you created https://github.com/gruntjs/grunt-glob and https://github.com/gruntjs/grunt-file, any chance those are happening in the short-term(er), or are those still in the "maybe" stage? IMO having those available as utility libs could be useful for this kind of feature.

@cowboy
Copy link

cowboy commented Jul 25, 2013

@jonschlinkert grunt-glob will eventually be the new name of globule, which you can use right now. grunt-file is going to take a little longer, because I need to figure out how I'm going to handle logging first.

@jonschlinkert
Copy link
Contributor

@cowboy, thanks

so @luk3thomas I'll just wait and see what you come up with and we can go from there. thanks!

@luk3thomas
Copy link
Author

Ok thanks, @jonschlinkert. I'll take a look and post some thoughts later

@jonschlinkert
Copy link
Contributor

👍

@matthew-dean
Copy link
Member

I have an idea how to support a number of "node" features like this one with some rewriting to browser mode.

@jonschlinkert
Copy link
Contributor

I have an idea how to support a number of "node" features

start thinking out loud on here then lol. let's get these ideas flowing so people can build on them!

@lukeapage
Copy link
Member

there should be a well defined interface to the environment.. 1.5.0-wip is closer to that though not there yet. We should add a function on the environment importer that asks the importer if the url might be for multiple imports, then another function with callback that returns those imports. Then we add a little bit of extra code to the import visitor that calls these functions in order to get a list of imports and expands the one import into multiple before continuing with the standard import process.

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

No branches or pull requests

5 participants