Static Assets and RCL behaviour - Is it possible t...
# help-with-other
n
I have an RCL that has JS and CSS files in it, I am attempting to override a small JS file for testing purposes without having to recompile and my RCL and make it available in a feed to be consumed just for testing purposes - however I get the following error:
Conflicting assets with the same target path
My google-fu has failed me and I cannot find any deffinitive answers as to whether this is possible with static assets or not. I've been able to do it with view files in the past but this is the first time I've tried with a CSS/JS file. Any pointers /answers would be great 🙂
a
When testing stuff locally on your own machine, you can edit the assets directly. When you install a NuGet package, it is extracted in
C:\Users\{users}\.nuget\packages\{packageName}\{alias}
. If the package is an RCL, the assets are specifically extracted at
staticwebassets
sub folder. Here you can just edit them for testing purposes, and you can immediately see the change in your website (don't even need to recompile). I use this a lot when testing various smaller adjustments before adding them back to the actual package code. It's however important to note that if you make changes to the extracted package locally, it will affect all the sites you run locally that is using this particular version of the package. I have a setup so that if I build for debug, a timestamp is appended to the version number. For one, this means that I don't have to bump the version number when testing a package locally, but I typically only change assets the way described above for package that have this timestamp - ensuring that I don't accidentally change a release version of the package, and can't figure out why something is not working in an entirely different project consuming this package. https://github.com/skybrud/Skybrud.Umbraco.Redirects/blob/v13/main/src/Skybrud.Umbraco.Redirects/Skybrud.Umbraco.Redirects.csproj#L14 https://github.com/skybrud/Skybrud.Umbraco.Redirects/blob/v13/main/debug.bat#L2
n
But shouldn't you be able to override static assets that are served from and RCL with local versions? I thought that was the point of rcls?
a
Might be with Razor views. I haven't figured out how to do it with other assets...
h
I think you can only override cshtml files
m
thread here but in short the overrides are only for view (cshtml) files.. but there is an override suggestion for static assets https://discord.com/channels/869656431308189746/1266311941996154982/1267615740307968142 Though I think you could also do it with urlrewrite/Irule?
17 Views