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

Glob syntax not supported for Windows out of the box [with esbuild] #28

Closed
JenteSL opened this issue Sep 19, 2021 · 4 comments
Closed

Comments

@JenteSL
Copy link

JenteSL commented Sep 19, 2021

Currently, the build script involves: esbuild app/javascript/*.* --bundle --outdir=app/assets/builds

On Windows, this results in an error: Could not resolve "'app/javascript/*.*'" (glob syntax must be expanded first before passing the paths to esbuild).

From what I've found troubleshooting, it appears that the glob syntax is a shell-specific feature. esbuild does not interpret it on its own. With PowerShell or CMD on Windows not supporting the glob syntax properly, the build commands doesn't work out of the box in these shell environments.

I'm not sure how to go on from here for a general solution. For now, in my project I changed the build script to reference the only .js file I have: esbuild app/javascript/application.js --bundle --outdir=app/assets/builds

@dhh
Copy link
Member

dhh commented Sep 19, 2021

Would be nice to have a section in the README about Windows considerations 👍

@dhh
Copy link
Member

dhh commented Sep 29, 2021

We could actually also detect Windows in the install script and change the default build script proposed. Feel free to have a look at that if you'd like!

@JenteSL
Copy link
Author

JenteSL commented Oct 2, 2021

Yeah, the only problem is that I'm not sure which command could do the trick on Windows, without specifying all the js files.

I'm not sure it is possible without an esbuild config file and something like an external glob package...

@dhh
Copy link
Member

dhh commented Nov 5, 2021

Documented it via 95e6b15

@dhh dhh closed this as completed Nov 5, 2021
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

2 participants