hyrious

Results 217 comments of hyrious

The extra chunk can exist because of common dependencies of your entrypoints including `src/js/theme.js` and the dynamic-imported ones. Let me give you a minimal example: ```js // a.js import {...

It looks like you're bundling your ESM code into CommonJS (or IIFE), but with "lodash-es" being externalized. (i.e. `esbuild index.mjs --bundle --format=cjs --external:lodash-es`) There are a few problems: 0. In...

> ``` > format: 'cjs', > ``` That's the cause. While as I know jest cannot run in ESM mode, so you may not be able to use lodash-es with...

I guess #1794 should be the same thing where an unused variable **name** (either from import another file or just `var a = side_effect()`) not being removed. I want to...

This was because when you returned **absolute** path in `onResolve` (via the alias plugin), the **resolve** step finished and esbuild start to **load** it. ``` esbuld.build(entry) -> resolve(path): absolute-path ->...

Interesting, I think it has a workaround to manually keep jsx elements by wrapping with something that uses them, like `-` (minus): ```jsx - ; ``` `esbuild --loader=jsx --jsx=automatic --tree-shaking`...

Searching "WrapESM" in the source: https://github.com/evanw/esbuild/blob/6d4f9028083b8f9bf77be9492d713d6c2294959e/internal/bundler/linker.go#L1293-L1313 Basically two circumstances: 1. You are using `require()` to import an ESM module. 2. You does not enable `splitting`, then any dynamic import will...

There's a workaround to still apply tree-shaking to lazy modules -- add a wrapper to re-export names you need: ```js // components.js export let a = 1 export let b...

~~It's weird, I refreshed (re-bundled) and it works again…~~ Edit: I found the right way to reproduce: toggle mathjs version to ^6, wait for it bundled, **then** toggle it to...

No :/ but it's very often. You can click the [link](https://codesandbox.io/s/cjs-resolver-issue-xqwezd?file=/src/index.js) above to try seeing this error. (I just verified again it is there.) If not, try toggling mathjs versions....