SquishIt
SquishIt copied to clipboard
EmbeddedResourceResolver does not support .less files
Since EmbeddedResourceResolver.ResolveFile uses tempPathProvider I see no way how the resolver can support .less files. Are you going to fix it?
Anyway many thanks for your work!
Hmm this is more an oversight than anything else. I think I could take the extensions of the incoming file and bolt them onto the end of the filename. If that works its an easy fix, will give it a shot tonight.
Can you try using this nuget package? https://www.nuget.org/packages/SquishIt/0.9.8-beta1
Install using the -pre flag. I think it will work now.
Great! So quick. Thank you very much. That is what I supposed to do too. Yes now the Preprocessor will catch a less file.
But am afraid that this is not so simple and it may require more work because of the @imports inside the .less sheets.
You see it is anyway a temp path so the imports will not work.
Is it possible to use some project relative path or parameter instead of the temp path?
However am going to try it again. Regards!
That would end up being a lot more work because imports are so closely tied to the filesystem.
The best way I can think of offhand to solve the problem would be to use a custom directive eg
@import-embedded "SquishItAspNetMvcTest://EmbeddedResource.Embedded.css"
Then we'd know to use the embedded resource resolver to find that content. This is not an especially easy task though, and debugging support could become a nightmare.
Why do you need to package your .less as an embedded resource?
Hi Alex. You see - mostly experimental. I use all the resources in a separate project (dll). Sort of a detached theme. Wouldn't say that it is fully effective but so far works good enough if not using LESS, but I would like to.
Anyway thank you for help very much and best regards!
I thought it might be something like that.
My unsolicited advice in that kind of situation would be to combine your .less as a build step (using bundler, grunt or similar) and include the resulting CSS file in your DLL instead of all your development .less files. That way consumers don't need to worry about having less preprocessors and the like running in their project if they don't need them.
Hi Alex I'll think of it by all means. Need to try. Thanks for your help sincerely.