hyrious
hyrious
This is because the module `he` is an UMD module (where esbuild can only handle CJS and ESM inputs). You may have to adjust its source code to make it...
It is possible to change that field by adding inline sourcemap to virtual modules returned by plugins, namely: ```js onLoad({ filter: /.*/ }, async args => { let { code:...
I mean this issue can be solved from the plugin code by adding sourcemaps to virtual modules, while not possible to be configured from the outside. It is still possible...
Here's a dead-simple example of doing manual chunks (#207) by yourself: [esbuild-split-vendors-example](https://github.com/hyrious/esbuild-split-vendors-example) It doesn't include some more complex logic like 1. Scan deps. Most of the time `pkg.dependencies` is what...
@graup Tree-shaking has little relation with code splitting. I even doubt whether it's possible to apply vanilla-extract on thrid-party libraries. - Tree-shaking means "remove unused tree nodes". If you think...
Code splitting is still very experimental in esbuild and it only supports esm. There is a [tsup/cjs-splitting](https://github.com/egoist/tsup/blob/dev/src/plugins/cjs-splitting.ts) to polyfill it in this way: 1. Bundle the package with `format: 'esm',...
There is an existing workaround in [tsup/cjs_shims.js](https://github.com/egoist/tsup/blob/dev/assets/cjs_shims.js) by injecting `import.meta.url` manually: `esbuild main.mjs --bundle --define:import.meta.url=importMetaUrl --inject:cjs_shims.js --format=esm` ```js // cjs_shims.js var getImportMetaUrl = () => typeof document === "undefined" ?...
Looks like files including import_star has been considered commonjs: https://github.com/evanw/esbuild/blob/ed341b0c7920d6638b872121ffc8e75e5761bdca/internal/bundler/linker.go#L1249-L1253
@fregante You can get output stats with [`logLevel: 'info'`](https://esbuild.github.io/api/#log-level), or try parse the [`metafile`](https://esbuild.github.io/api/#metafile) by yourself ([an example of mine](https://github.com/hyrious/esbuild-repl/blob/fab9c82fe6193cf930a15039de5f540c507aee82/scripts/build.ts#L35)). --- Talk back to the issue, I have made `--plugin:xxx`...
You can only turn on "minifyIdentifiers" to remove that string.