mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 21:10:54 +08:00
Dedupe assetbundle
This commit is contained in:
parent
75e852451c
commit
1889973af1
@ -61,6 +61,8 @@ func (a *AssetBundle) processHTML(htmldata string) error {
|
||||
buf := bytes.NewBufferString(htmldata)
|
||||
tokenizer := html.NewTokenizer(buf)
|
||||
|
||||
paths := slicer.String()
|
||||
|
||||
for {
|
||||
//get the next token type
|
||||
tokenType := tokenizer.Next()
|
||||
@ -109,7 +111,12 @@ func (a *AssetBundle) processHTML(htmldata string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
a.assets = append(a.assets, asset)
|
||||
|
||||
// Ensure we don't include duplicates
|
||||
if !paths.Contains(asset.Path) {
|
||||
a.assets = append(a.assets, asset)
|
||||
paths.Add(asset.Path)
|
||||
}
|
||||
}
|
||||
if "script" == token.Data {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user