AssetSync/asset_sync

Support Webpacker assets by default

Opened this issue ยท 6 comments

With Webpacker being builtin and enabled by default in current rails - does it make sense to transparently default to supporting Webpacker assets if it's being used?

Would a PR adding this to the default value of add_local_file_paths be welcome?

Beyond default value, the great benefit would be only uploading based on a diff/manifest like the sprockets assets.

Uploading all packs/ files when most have not changed is steadily increasing my deployment time now at 3 minutes just for asset_sync alone.

[EDIT] I added a function to get the packs/ folder in the S3 bucket to compare a diff. Now it won't upload all pack files, only the new/changed ones.

jenfi-eng@c5f1f4f

Once you do this, you may want to add the packs/manifest.json(.gz) to the always upload. If not, the manifest will never change since it's not fingerprinted with webpacker. Only strictly necessary if S3 is the canonical location for all servers. Most of the time this isn't the case.

# asset_sync.rb
config.always_upload = ['manifest.json', 'manifest.json.gz']

WARNING: This is meant as an example only. It is untested and hardcoded to our use case.

Did anything ever happen with this? Or do we have to precompile and upload assets manually?

I think currently Webpacker support is like this section in README

I think currently Webpacker support is like this section in README

Thank you! That did it. This should be like, highlighted and pinned lol

There is a section actually
Maybe adding a "README index" later
If I remember ~

I see I just didn't read far enough down ๐Ÿ˜… thanks!