I have several assets that aren’t referenced in CSS or JS, but are used inside some Blade template files.
I’m attempting to set up my Bud config so these assets are copied and versioned/hashed the same way as the files that are referenced in CSS/JS are. I’ve tried various combinations, but none of them work exactly as intended. The two most noteworthy attempts are below.
- The below code results in all images being copied over, but without hashing/versioning. The images referenced in CSS/JS are then copied a second time with a hash. However, the manifest.json file ends up not referencing any of those hashed versions.
app
.entry({
app: ['@scripts/app', '@styles/app'],
})
.assets([
[app.path('@src/images'), app.path('@dist')],
])
- The below code avoids the image duplication, but obviously results in zero hashing/versioning. Setting the hash parameter to true has the same outcome as in #1 above.
app
.hash(false)
.entry({
app: ['@scripts/app', '@styles/app'],
})
.assets([
[app.path('@src/images'), app.path('@dist')],
])
How do I properly configure this so that all images are only brought over once and they are all properly versioned/hashed and added to the manifest.json?