Smidge an External Resource in Partial View
# help-with-umbraco
t
Does Smidge not play nicely when trying to include an external resource using the SmidgeHelper in a partial view? Something like
SmidgeHelper.RequiresJs($"https://somescript.js");
I would expect the above to be smidged in but yet it is not, is this a known working thing? Local script resources get included and rendered just fine? Umbraco 11.4
I should add Ive busted the cache in the appSettings upon restart as well
d
I'm not very familiar with smidge, but what are you seeing and what are you expecting? Is your source not included at all, or is it included, but in a way that you didn't expect? If it's the former, I would recommend checking the order of execution of your razor templates.
t
Does order of operations matter if the scripts are unique to a partial? As the script would only get included if the partial is used?
d
My thought was that perhaps the script tags are rendered before your call to
RequireJs
is made. So smidge might not know that your asset exists
j
No, Smidge doesn't do external scripts - only local files.
k
Actually smidge should support external scripts. It is a bit unintuitive in the way that it works though. It doesn't work for named bundles and it creates standalone script tags for external resources. https://github.com/Shazwazza/Smidge/issues/20#issuecomment-198369543
j
That's interesting, so it'll include them but not minify etc. (which makes a lot of sense)
t
But what If Im not seeing a script tag output for an external resource at all?
k
@TECKSPEED Are you seeing your local scripts rendering fine?
What does the url for the external script look like and does anything change if you set smidge to debug mode?
t
Figured it out apparently uSkinned doesn’t call RenderJsHere()
6 Views