-
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: input source file with --depends options #2476
Comments
Sounds sensible - i dont use this (or make) so i cant say whats right.
Might be worth referencing the person who added this feature way back and
decided to exclude the entry file.
|
Good idea. What do you think, @StefanWallin? Another detail I just realized - running with the depends option still writes the file, which kind of defeats the purpose of using make. So I also suggest making |
I've long since left the company where we used this and as such, I have not personally used this feature or Make in about 2.5 years. I think we have a reason that made me not want the sourcefile being included in the list of dependencies. Logically speaking, the source file is not a dependency of it self. I'm trying to get a hold of the people that have the code using this part of lessc. On the other hand, during these 3 years since implementation I'd say that people have probably used this feature and gotten around this issue and that this might be incorporating a breaking change for those people. |
My old coworker just left the office, he will check on the issue tomorrow. |
I agree that this isn't worth introducing a breaking change if this is an important feature. What you say about source not being a dependency of itself makes me think that it would actually make the most sense if the command output something like this: $ lessc --depends source.less
source.less: foo.less bar.less Maybe that could be the output of dest.css is omitted. |
If you would like to implement this new feature, you might be better off trying to replicate the behaviour of gcc, with it's flags of -M, -MM, -MF, -MD, -MMD & -MG as appropriate for the less compiler. We should probably adhere to existing patterns that exist within the make community. Especially in contrast to introduce any breaking changes. For more details: Our usage was that we had dynamic target files AA...An that had dependencies BA...Gn. For each target we generated roughly 6 outputs where any change of any share dependency that was shared all the targets and their outputs would be invalidated and recreated. But hey, It's not my project, I'm not actively using less anymore(switched to rails & sass), and my old workplace is using ninja instead of make nowadays. |
You could add a flag to do different kind of ouputs, but then again, I'm not sure how big impact on the existing make+less community this would have. |
For whatever my opinion is worth, I think having an additional flag to only output to stdout would be helpful. I've got a plugin for compiling Less that utilizes --depends, and some users are complaining about the extraneous file that gets created. While of course it won't be hard to just delete the file after running, it would be nice if I had some way of getting the information without creating the file in the first place. |
You can generate a sourcemap and also extract the sources from that. But that only lists the root and other referenced files if they directly generate output. It would be nice if there were a more direct way to retrieve a full list of "related" or referenced files (but I don't use make, so I'm unfamiliar with this feature). |
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. |
Right now, when one runs:
lessc --depends source.less dest.css
, the result is:dest.css: (imports in source.less)
source.less
is notably omitted from the list of prerequisites for dest.css. This means thatmake
will not re-run the command ifsource.less
is the only changed file. A better result would bedest.css: source.less (imports in source.less)
I believe the only change required is on line 413 of bin/lessc and have a patch ready.
The text was updated successfully, but these errors were encountered: