-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Feature request: "resolve @import only" mode #2428
Comments
Why? How is it useful? |
It would require the format less feature as a pre-requisite too. I'm guessing its so that a library can provide a single less file instead if multiple less files. |
The main use case would be exactly like what @lukeapage said : serving a single less file instead of multiple ones. A single file is often easier to version-manage and add into a build system (even if it's not totally impossible to use a directory). This proposal is linked to the mentionned issue, but is not driven by it; both of them were required to fit what I had in mind (which you may or may not want to implement). As a side note, you've been really fast to react on both issues! |
Maybe not. It sounds like it would be an as-is inline dump of the contents of the Less file at the point of @import. BUT my guess is that's not a trivial change in flow, since currently Less files are fully imported into the AST, and then converted / formatted back out to CSS, if I'm not mistaken. And it sounds like a fairly custom feature. I would think at the least it would be a parse plugin, that takes the contents after import (and before render) and simply allows you to pull out the strings of each file and concatenate them. |
So I don't get it. Initially you create and edit a multifile project then "compile" it to a singe file and then keep editing the "compiled" version? Hmm... This sounds at least strange. |
I think the idea is libraries would produce a versioned single .less file I'm not sure its worth it, but if less were extended to pretty print (or a |
Rereading actually
If less was modified to allow a pre-import visitor you could create a |
If the files are directly put into the AST, wouldn't a visitor walking over the resulting AST be enough ? I'm not sure how less works, but according to the other thread, the variables are lazy loaded, so I guess that there is a step between the @import resolution and the rest of the processing where something could be plugged. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have a good use case for this: a huge Less codebase with lots of |
I'm afraid it's not good enough to be worth almost doubling the compiler code. (Yet again the compiler parses the input Less code into internal AST format where every language entity is represented with a JS object and then there's nothing that can convert these JS objects of various types back to corresponding Less text). |
High on my "regulations that would be 1000× more useful than the cookie law" list: ban parsers that don't store enough info in the AST to enable character-for-character reconstruction of the input. I hope |
Yet again, it does store all the info for reconstruction, it's just the reconstruction itself would require a bloat of new code (yet again because the AST is designed specifically to produce CSS after language statements are evaluated... That's why it's named a compiler and not a "text-search-and-replace-library").
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I think it would be great to have a way to generate a single less file from another set of files. For example, the following:
foo.less
bar.less
Would give
output.less
Instead of
output.css
It would be very useful, together with the !default feature.
The text was updated successfully, but these errors were encountered: