5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 04:49:20 +08:00

fix: support rel="modulepreload" on assetbundle as javascript (#621)

In some bundler enviroments like vite the output on index.html uses link
tag with rel="modulepreload" to load javascript, add support to handle
this files on assetbundle, more info
https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/modulepreload

fix #620

Co-authored-by: amaury-tobias <amaury.tobiasqr@gmai.com>
This commit is contained in:
Amaury Tobias Quiroz 2021-03-19 22:51:57 -06:00 committed by GitHub
parent cbd98b5a1a
commit b1a42c8dea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,6 +112,9 @@ func (a *AssetBundle) processHTML(htmldata string) error {
if attr.Key == "as" && attr.Val == "script" {
asset.Type = AssetTypes.JS
}
if attr.Key == "rel" && attr.Val == "modulepreload" {
asset.Type = AssetTypes.JS
}
}
// Ensure we don't include duplicates