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:
parent
cbd98b5a1a
commit
b1a42c8dea
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user