Closed tgaff closed 1 year ago
Adding --asset-names=[name]-[hash].digested
causes the build to fail with error
No matches found: "--asset-names=[name]-[hash].digested"
Full scripts.build in package.json:
"build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets --loader:.png=file --asset-names=[name]-[hash].digested",
Versions
--
EDIT: Turns out all I had to do was to wrap the value of --asset-names in quotes:
"build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets --loader:.png=file --asset-names=\"[name]-[hash].digested\"",
Sorry for the noise!
@shrmnk I'm curious why you had to do that. I tried a few different scenarios like spaces and couldn't reproduce it. Is there something different about your platform? (I didn't try Windows). Symbols in file names maybe?
Hmm yeah that's possible. I'm on macOS, zsh.
Same platform and shell as me. 🤷
This should resolve #76 at least for the default esbuild case. Sprockets has already added support for ignoring
.digested
assets.As a demonstration I have a reproduction case repo here.
Note the above deploys are "free" render.com instances. You may need to wait and retry after the initial request while it spins up.
The diff between the two is merely:
This is mainly a doc change, walking through making this change to the build script.
However, I think there may be a good argument to be made for just including these in the build script by default. Not every user will need it but it probably wouldn't do any harm. (Not sure if we'd want just png, or if we want to include other formats) Please let me know if you'd like me to prepare that change.