hyrious

Results 217 comments of hyrious

That was because `experimentalDecorators` implies lowering all static fields to avoid the issue when referencing the class name in static fields, which implies lowering all instance fields to avoid the...

A quick plugin to replace `import.meta.url` to file url string: ```js { name: 'import.meta.url', setup({ onLoad }) { let fs = require('fs') let url = require('url') // TODO: change /()/...

@GenrikhFetischev how about replace them to `url.pathToFileURL(__filename)`

> looks like there is might be a problem with esm -> cjs compilation. No, it seems a bug in yargs itself. Try this vanilla esm code: ```js import yargs...

@fregante You got empty `import.meta` because this thing only exist in es modules context (`--format=esm`), and esbuild by default bundles to `iife` format. Transforming the esm keyword to iife or...

@fregante This is because the default loader is `js`, but the file content is tsx. To let esbuild choose correct loader, simply put `loader: 'default'`. See [my comment at your...

@xkn1ght The which file to be bundled is determined by how code import it, esbuild is somewhat align to Node.js's native es modules' behavior. Since you write `import`, it will...

Looks like it has been fixed in 0.14.5? Update: maybe not, I'll have to test more to come up with a newer reproduction.

Now to reproduce it, you have to having require in 2+ files with splitting on: [(live link)](https://hyrious.me/esbuild-repl/?version=0.14.23&mode=build&modules=%5B%5B%22a.js%22%2C%22require+%2F%2F+try+comment+out+this%22%2C1%5D%2C%5B%22b.js%22%2C%22require%22%2C1%5D%5D&buildOptions=%7B%22bundle%22%3Atrue%2C%22format%22%3A%22esm%22%2C%22splitting%22%3Atrue%7D). I guess this is because shared runtime helpers are merged before being shaked....

@tennox Your link is still using 0.14.23 version of esbuild (you can change the version at the top-right corner). Here's the latest reproduction: https://esbuild.github.io/try/#YgAwLjE5LjEwAHsKICAiYnVuZGxlIjogdHJ1ZSwKICAiZm9ybWF0IjogImVzbSIsCiAgInNwbGl0dGluZyI6IHRydWUsCiAgInRyZWVTaGFraW5nIjogZmFsc2UsCiAgIm91dGRpciI6ICIvIiwKICAiYWxsb3dPdmVyd3JpdGUiOiB0cnVlCn0AZQBhLmpzAGltcG9ydCB7IHggfSBmcm9tICIuL3guanMiAGUAYi5qcwBpbXBvcnQgeyB4IH0gZnJvbSAiLi94LmpzIgAAeC5qcwBleHBvcnQgdmFyIHggPSAx