hyrious

Results 217 comments of hyrious

Simply impossible for now. However, if you do not capture and re-export the namespace object, it will be shaked. [demo](https://esbuild.github.io/try/#YgAwLjI1LjEwAC0tYnVuZGxlAGUAZW50cnkuanMAaW1wb3J0IHsgRm9vIH0gZnJvbSAiLiI7CgpsZXQgZm9vID0gbmV3IEZvbygpOwpmb28uZm9vKCk7AABpbmRleC5qcwBleHBvcnQgKiBmcm9tICIuL0RpciI7AABEaXIvaW5kZXguanMAZXhwb3J0ICogZnJvbSAiLi9Gb28iOwovKiBAX19OT19TSURFX0VGRkVDVFNfXyAqLyBleHBvcnQgKiBmcm9tICIuL0JhciI7AABEaXIvRm9vLmpzAGV4cG9ydCBjbGFzcyBGb28KewogIGZvbygpIHsgY29uc29sZS5sb2coImZvbyIpOyB9Cn0AAERpci9CYXIuanMALyogQF9fTk9fU0lERV9FRkZFQ1RTX18gKi8gZXhwb3J0IGNsYXNzIEJhcgp7CiAgYmFyKCkgeyBjb25zb2xlLmxvZygiYmFyIil9Cn0AAHBhY2thZ2UuanNvbgB7CiAgInNpZGVFZmZlY3RzIjogZmFsc2UKfQ)

Why not declaring your `VAR1` as a local variable instead of a global one? ```js // config.js var VAR1_ = VAR1 // [--define:VAR1=window.location] => var VAR1_ = window.location export {VAR1_...

@jetwiwo FYI esbuild 0.25.6 works fine on my Windows setup. It seems you're running esbuild from bash.exe from git, and Windows Defender is blocking bash.exe from executing another exe. Executing...

Maybe in the serve mode esbuild should disable "rebuild on request" after the first build task when watch mode is also enabled. Should we assume that since the watch mode...

[`` import(`./${name}.ts`) ``](https://esbuild.github.io/try/#YgAwLjI1LjEwAHtidW5kbGU6IHRydWUsIGZvcm1hdDogJ2VzbScsIHRhcmdldDogJ2VzMjAyNCcsIG1pbmlmeTogdHJ1ZSwgb3V0ZGlyOiAnZGlzdCcsIHNwbGl0dGluZzogdHJ1ZX0AZQBlbnRyeS50cwBjb25zdCBuYW1lID0gInRlc3QiOwppbXBvcnQoYC4vJHtuYW1lfS50c2ApAGUAZm9vLnRzAGZvbwBlAGRlcnAudHMAZGVycA) should work. The glob import seems only matches the full, original path.

You can use [`--supported:import-meta=true`](https://esbuild.github.io/api/#supported).

I **think** you can already do that with a plugin to generate a custom content with loader: "text". [example](https://esbuild.github.io/try/#YgAwLjI1LjYAewogIGJ1bmRsZTogdHJ1ZSwKICBwbHVnaW5zOiBbewogICAgbmFtZTogJ215LWRhdGF1cmwnLAogICAgc2V0dXAoYikgewogICAgICBiLm9uTG9hZCh7IGZpbHRlcjogL1wudHh0JC8gfSwgYXJncyA9PiB7CiAgICAgICAgaWYgKGFyZ3Mud2l0aC5taW1lID09PSAnaW1hZ2UvZ2lmJykgewogICAgICAgICAgbGV0IGJ1ZmZlciA9ICdoZWxsbycgLy8gbW9jayBkYXRhLCBubyBmcyBpbiB0aGUgYnJvd3Nlci4KICAgICAgICAgIGxldCBjb250ZW50cyA9ICdkYXRhOmltYWdlL2dpZiwnICsgYnRvYShidWZmZXIpIC8vIHVzZSBidWZmZXIudG9TdHJpbmcoJ2Jhc2U2NCcpCiAgICAgICAgICByZXR1cm4geyBjb250ZW50cywgbG9hZGVyOiAndGV4dCcgfQogICAgICAgIH0KICAgICAgfSkKICAgIH0KICB9XQp9AGUAZW50cnkuanMAaW1wb3J0IGEgZnJvbSAnLi9hLnR4dCcgd2l0aCB7IG1pbWU6ICJpbWFnZS9naWYiIH0KY29uc29sZS5sb2coYSkAAGEudHh0AGhlbGxv)

I guess the `ƒ [window.foo]() {}` printed on browser devtools is only because the devtool extracts the function body (`func.toString()`). In other environments it will be different, like it is...

I guess the following example may be what you really want to check out: ```js globalThis.foo = 'name' class Foo { static get [globalThis.foo]() { return 'Bar' } } console.log(Foo.name)...

Yes, I get you. The whole thing is if a class has a static field or method named (by indirect expression) "name", then the `keepNames` feature may mess up this...