Skip to content

Commit

Permalink
build: remove global polyfill and add conditions for worker (#350)
Browse files Browse the repository at this point in the history
# Motivation

Remove global polyfill and add conditions in esbuild for better compatibility with web worker.

# Notes

I found this change in esbuild repo discussion [#1189](evanw/esbuild#1189) and implemented in in Juno friday to fix the compatibility with web workers [#37](junobuild/juno-js#37).

I have packaged all libs and tested in NNS-dapp.
  • Loading branch information
peterpeterparker authored Jun 19, 2023
1 parent 5433952 commit 43e8dfd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ const buildEsmCjs = () => {
minify: true,
splitting: true,
format: "esm",
define: { global: "window" },
target: ["esnext"],
platform: "browser",
conditions: ["worker", "browser"],
external: [
...Object.keys(commonPeerDependencies),
...Object.keys(workspacePeerDependencies),
Expand Down

0 comments on commit 43e8dfd

Please sign in to comment.