@galacean/engine-loader 0.0.0-experimental-double11.7 → 0.0.0-experimental-double11.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2442,6 +2442,28 @@ var AbstractTranscoder = /*#__PURE__*/ function() {
2442
2442
  /** @internal */ function TranscodeWorkerCode$1() {
2443
2443
  self.onmessage = function onmessage(event) {
2444
2444
  var message = event.data;
2445
+ var _init = function _init() {
2446
+ var initPromise;
2447
+ return function(wasmBinary) {
2448
+ if (!initPromise) {
2449
+ initPromise = new Promise(function(resolve, reject) {
2450
+ var BasisModule = {
2451
+ wasmBinary: wasmBinary,
2452
+ onRuntimeInitialized: function() {
2453
+ return resolve(BasisModule);
2454
+ },
2455
+ onAbort: reject
2456
+ };
2457
+ self["BASIS"](BasisModule);
2458
+ }).then(function(BasisModule) {
2459
+ BasisModule.initializeBasis();
2460
+ return BasisModule.KTX2File;
2461
+ });
2462
+ }
2463
+ return initPromise;
2464
+ };
2465
+ };
2466
+ var init = _init();
2445
2467
  switch(message.type){
2446
2468
  case "init":
2447
2469
  init(message.transcoderWasm).then(function() {
package/dist/module.js CHANGED
@@ -2437,6 +2437,28 @@ var AbstractTranscoder = /*#__PURE__*/ function() {
2437
2437
  /** @internal */ function TranscodeWorkerCode$1() {
2438
2438
  self.onmessage = function onmessage(event) {
2439
2439
  var message = event.data;
2440
+ var _init = function _init() {
2441
+ var initPromise;
2442
+ return function(wasmBinary) {
2443
+ if (!initPromise) {
2444
+ initPromise = new Promise(function(resolve, reject) {
2445
+ var BasisModule = {
2446
+ wasmBinary: wasmBinary,
2447
+ onRuntimeInitialized: function() {
2448
+ return resolve(BasisModule);
2449
+ },
2450
+ onAbort: reject
2451
+ };
2452
+ self["BASIS"](BasisModule);
2453
+ }).then(function(BasisModule) {
2454
+ BasisModule.initializeBasis();
2455
+ return BasisModule.KTX2File;
2456
+ });
2457
+ }
2458
+ return initPromise;
2459
+ };
2460
+ };
2461
+ var init = _init();
2440
2462
  switch(message.type){
2441
2463
  case "init":
2442
2464
  init(message.transcoderWasm).then(function() {