Skip to content
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

When using --servedir, does not bundle #3269

Closed
phlegmaticprogrammer opened this issue Jul 22, 2023 · 1 comment
Closed

When using --servedir, does not bundle #3269

phlegmaticprogrammer opened this issue Jul 22, 2023 · 1 comment

Comments

@phlegmaticprogrammer
Copy link

phlegmaticprogrammer commented Jul 22, 2023

I am using esbuild for the first time, so I am not sure if this is a bug.

I am using esbuild version 0.18.15 with node v16.15.1 on macos 12.6.1. The command

./node_modules/.bin/esbuild src/index.ts --outdir=web --bundle --servedir=web --watch

starts a server, and leads to this output when changing src/index.ts repeatedly:


 > Local:   http://127.0.0.1:8000/
 > Local:   http://127.51.68.120:8000/
 > Network: http://192.168.1.90:8000/

[watch] build finished, watching for changes...
[watch] build started (change: "src/index.ts")
[watch] build finished
[watch] build started (change: "src/index.ts")
[watch] build finished
[watch] build started (change: "src/index.ts")
[watch] build finished

But the file web/index.js is not generated!

On the other hand, when I leave out --serverdir=web, then everything works as expected, and web/index.js gets generated.

@phlegmaticprogrammer
Copy link
Author

I found the answer here: #796

Apparently the index.js is not written when using --servedir, but is overlayed in memory over the directory. Cool! Would probably be good to add that to the documentation of "Serve".

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

No branches or pull requests

1 participant