You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you considered doing this with an esbuild plugin and bundle: true? The plugin could mark all imported paths as external but have the side effect of kicking off additional builds (as long as the path hasn't been seen before). That should let you experiment with doing this.
I found that it worked for my purposes, but that dynamic importing did not work when using default exports.
$ node scripts/build.js
$ node dist/src/a.js
Hello, World!
/path/to/esbuild-external-dynamic-load-bug/dist/src/a.js:28
b.default();
^
TypeError: b.default is not a function
at dynamicLoadBug (/path/to/esbuild-external-dynamic-load-bug/dist/src/a.js:28:12)
I was trying an idea mentioned here: #944
I found that it worked for my purposes, but that dynamic importing did not work when using default exports.
Example to reproduce:
./package.json
:./src/a.js
:./src/b.js
:./script/build.ts
:With this plugin of mine, I get this result:
But without using the plugin, I get:
The code causing the error looks like:
And if I manually change it to:
I get the same output as the normal, non-plugin setup.
The text was updated successfully, but these errors were encountered: