Hello, indeed, it's not a good thing if there is no easy way to solve this. The only workarounds I can think of right now are hacks, like adding a build task to replace url in all output htmls, or removing the <script ws-replace="scripts"></script> hole from html template and fill in by hand (but it is brittle if you add more dependencies needing more scripts).

So I have added a task to track proper implementation, coming soon https://github.com/dotnet-websharper/core/issues/1135

By on 6/15/2021 8:36 AM ()

Thanks, I appreciate the prompt responses. For the moment, I have been able to set my own jQuery resource type instead of requiring WebSharper.JQuery.Resources.JQuery. I expect it may appear again dependent on the WebSharper functionality used.

1
2
3
type MyJQuery() =
    inherit Resources.BaseResource("Resources",
        "jquery-3.6.0.min.js")
By on 6/15/2021 9:54 PM ()

Hello, features to enhance offline sitelets resource handling are now released in https://github.com/dotnet-websharper/core/releases/tag/4.7.2.445

You can either set WebSharperDownloadResources in proj settings (see https://developers.websharper.com/docs/v4.x/fs/project-variables#heading-9) which would need net connection for compile time, but all remote resources are downloaded and linked from locally, or you can redirect resources with the Sitelet.WithSettings now part of WebSharper itself.

By on 6/23/2021 2:11 PM ()

I encountered a few limitations using downloadResources, but providing local files using Resources.BaseResource and Sitelet.WithSettings is an easy solution, thanks.

I found that downloadResources does not use the Sitelet.WithSettings override. For example: Sitelet.WithSettings [ "WebSharper.JQuery.Resources.JQuery", "https://code.jquery.com/jquery-3.6.0.min.js" ], jQuery 3.1.1 is downloaded locally while the page references the CDN for jQuery 3.6.0.

If there are additional external dependencies in the downloaded files, suitable versions will also need to be provided locally. For example, https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css references ./fonts/bootstrap-icons.woff2.

By on 6/28/2021 8:59 PM ()

Hello, I have created a ticket for it, you can track the issue here: https://github.com/dotnet-websharper/core/issues/1147

By on 7/1/2021 12:25 PM ()

The quickest way would be to adapt that bit to work on the latest WebSharper (will check on that), but it strikes me that overriding resource URLs don't work for offline sitelets. If that's so, it's definitely a bug.

By on 6/15/2021 4:04 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper