@aprovan/patchwork-compiler 0.1.2-dev.f456953 → 0.1.2-dev.f980716

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.
package/dist/index.cjs CHANGED
@@ -1564,13 +1564,15 @@ function disposeIframeBridge() {
1564
1564
  // src/compiler.ts
1565
1565
  var esbuildInitialized = false;
1566
1566
  var esbuildInitPromise = null;
1567
- async function initEsbuild() {
1567
+ var DEFAULT_ESBUILD_WASM_URL = "https://unpkg.com/esbuild-wasm/esbuild.wasm";
1568
+ async function initEsbuild(urlOverrides) {
1568
1569
  if (esbuildInitialized) return;
1569
1570
  if (esbuildInitPromise) return esbuildInitPromise;
1571
+ const wasmUrl = urlOverrides?.["esbuild-wasm/esbuild.wasm"] || DEFAULT_ESBUILD_WASM_URL;
1570
1572
  esbuildInitPromise = (async () => {
1571
1573
  try {
1572
1574
  await esbuild.initialize({
1573
- wasmURL: "https://unpkg.com/esbuild-wasm/esbuild.wasm"
1575
+ wasmURL: wasmUrl
1574
1576
  });
1575
1577
  esbuildInitialized = true;
1576
1578
  } catch (error) {
@@ -1593,7 +1595,7 @@ function hashContent(content) {
1593
1595
  return Math.abs(hash).toString(16).padStart(8, "0");
1594
1596
  }
1595
1597
  async function createCompiler(options) {
1596
- await initEsbuild();
1598
+ await initEsbuild(options.urlOverrides);
1597
1599
  const { image: imageSpec, proxyUrl, cdnBaseUrl: cdnBaseUrl3, widgetCdnBaseUrl } = options;
1598
1600
  if (cdnBaseUrl3) {
1599
1601
  setCdnBaseUrl(cdnBaseUrl3);