Evan Wallace

Results 542 comments of Evan Wallace

Ah, I see. I was mentioning this because the example code you posted is already wrapped in an IIFE, and has no top-level variables: ```js (function webpackUniversalModuleDefinition(root, factory) { ......

This isn't trivial to fix because the directives are separated from the rest of the file in the output (e.g. they must come outside the enclosing IIFE, if any). The...

This is a useful data point but I hesitate to make any assumptions based on a single data point. Especially when you consider compression, I imagine you can find cases...

The code you are looking at is the fallback for when `npm` isn't installed. Before this code runs, esbuild runs `npm install` which is supposed to be the way this...

Part of this is because the input to esbuild is a module, not a code fragment, so it's assumed that a transformation like this has no effect on the run-time...

Honestly I'm not sure what to recommend. Node's ESM+CJS support is a mess. Node set up their system so that publishing packages with both ESM and CJS is error-prone and...

The transform API and the build API with bundling disabled just pass through all imports unmodified. You need to enable bundling for esbuild to traverse into import paths.

> tell esbuild to ignore the warnings This is the way: https://esbuild.github.io/api/#log-override. Pass the log message name (in `[...]` at the end of the warning) to log override to adjust...

> for the `external` field to accept a function where i can determine the desired behavior myself There is already a way to do this for yourself: https://esbuild.github.io/plugins/#on-resolve