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

Support Webpacker assets by default #388

Open
DanielHeath opened this issue Aug 22, 2019 · 6 comments
Open

Support Webpacker assets by default #388

DanielHeath opened this issue Aug 22, 2019 · 6 comments

Comments

@DanielHeath
Copy link

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?

@nitsujri
Copy link

nitsujri commented Oct 3, 2019

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.

@willc0de4food
Copy link

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

@PikachuEXE
Copy link
Member

I think currently Webpacker support is like this section in README

@willc0de4food
Copy link

I think currently Webpacker support is like this section in README

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

@PikachuEXE
Copy link
Member

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

@willc0de4food
Copy link

I see I just didn't read far enough down 😅 thanks!

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

4 participants