Skip to content

jsgen: fix slightly incorrect JS (breaks esbuild) (fix #23711)#24676

Merged
spytheman merged 1 commit into
vlang:masterfrom
gchumillas:fix_slightly_incorrect_JS_breaks_esbuild
Jun 9, 2025
Merged

jsgen: fix slightly incorrect JS (breaks esbuild) (fix #23711)#24676
spytheman merged 1 commit into
vlang:masterfrom
gchumillas:fix_slightly_incorrect_JS_breaks_esbuild

Conversation

@gchumillas

@gchumillas gchumillas commented Jun 8, 2025

Copy link
Copy Markdown
Contributor

Fixes #23711

How to test in Linux (macos):

# install esbuild (if not already installed)
npm -g install esbuild

# compile and minimize the code
cd examples
v -skip-unused -backend js_browser -prod ./js_hello_world.v -o hello.js
esbuild --minify --platform=browser --bundle hello.js --outfile=hello.min.js

# run it
node hello.min.js

Output:

Hello from V.js (0)
Hello from V.js (1)
Hello from V.js (2)

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-23033

@spytheman

Copy link
Copy Markdown
Contributor

-skip-unused should be on by default now.

@spytheman

Copy link
Copy Markdown
Contributor

I've just checked, and it works on my machine, with latest esbuild as well, while failing on master:
image

@spytheman spytheman merged commit ee77475 into vlang:master Jun 9, 2025
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slightly incorrect JS (breaks esbuild)

2 participants