Migrate old externs 5/x

This commit is contained in:
2026-06-15 07:12:40 +08:00
parent 4f2131e317
commit a912d45b9a
24 changed files with 153 additions and 86 deletions
+15 -2
View File
@@ -252,8 +252,21 @@ func (r *Resolver) MergeJS(files []classmap.Resource) ([]byte, string, error) {
}
b.Write(src)
}
wrapped := append([]byte("(function(){"), b.Bytes()...)
wrapped = append(wrapped, []byte("})();")...)
prefix := []byte(`
/** @define {boolean} */
var DEFINE_DEBUG = false;
(function(){
`)
suffix := []byte(`
})();
`)
wrapped := make([]byte, 0, len(prefix)+b.Len()+len(suffix))
wrapped = append(wrapped, prefix...)
wrapped = append(wrapped, b.Bytes()...)
wrapped = append(wrapped, suffix...)
return wrapped, hashList(files, "js"), nil
}