Is there a way to push JS/CSS assets compiled during build to S3? I have an app that's using S3 for asset files (profile photos, misc uploaods) and ASSET_URL env is pointing to that bucket so we can use asset('profiles/user123.jpg');. Since Vite's @vite('reosurces/js/app.js') directive uses that same helper in the backend to figure out paths to JS/CSS is there a way to push those files to S3 (or a way to tell Vite where to look for them)?
You could use the AWS CLI linked into an NPM script:
aws s3 sync ./dist s3://bucket-name --delete
Simply change the /dist soruce folder path to your compiled assets and the S3 bucket to where you want them stored. The --delete flag will replace the existing files in the bucket with your new versions.