-
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
Issue with JSON values containing dash (-) or dot (.) #2292
Comments
That's said, the value of the record in If you need to replace some variable with complex initializing codes, you can use // FOO-shims.js
export let foo_bar = foo.bar;
// index.js
console.log(process.env.FOO); Then run: // output
var foo_bar = foo.bar;
console.log(foo_bar); |
Are you really trying to replace
If you are unfamiliar with how JSON works, the JSON specification has an excellent visual representation of what is allowed as a valid JSON value: https://www.json.org/json-en.html. |
Is dot reference not considered an 'identifier'? I'm trying to create define that injects
It doesn't seem there is way to express dot reference as any valid JSON or a single identifier, what is the suggested solution in that case? |
Yes, it actually wants a single variable name.
See the inject api like what I did in previous comment. However, in your referenced issue I see someone is doing |
esbuild: 0.14.42
MacOs: 12.4
NodeJS: 16.15.0
While running this JavaScript file (not TypeScript) on the console with
node build.js
When the JSON value is
foo_bar
everything is working fine 👍🏼When the JSON value is
foo-bar
orfoo.bar
I will get this errorCan somebody please tell me what I'm doing wrong?
Thanks in advance
The text was updated successfully, but these errors were encountered: