-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using inject with target=es6 -> export error #3343
Comments
There was a way to inject |
This feels more like a work-around than a proper solution I'm looking for, as it requires me to duplicate all shims into the build options. |
This was referenced Jun 19, 2024
This was referenced Jun 30, 2024
This was referenced Sep 17, 2024
This was referenced Sep 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use
inject
to shim some functions while targeting es6, but I am getting the following error due to theexport { fn as name }
syntax:Using a string as a module namespace identifier name is not supported in the configured target environment ("es2015")
Playground reproduction using the process.cwd example shim from the docs. Removing
target=es6
from the compiler options makes it build as expected.I've been trying alternatives (such as
export default { name: fn }
,module.exports = { name: fn }
) but using them causes esbuild to not use the shim. (export let name = fn
does work, however the name cannot contain dots in that case).Any advice would be appreciated 🙏
The text was updated successfully, but these errors were encountered: