Skip to content

Instantly share code, notes, and snippets.

@wadewinningham
Last active March 13, 2019 14:29
Show Gist options
  • Save wadewinningham/8729d39f1ca2631f58596bd65703536a to your computer and use it in GitHub Desktop.
Save wadewinningham/8729d39f1ca2631f58596bd65703536a to your computer and use it in GitHub Desktop.

Webpacker 4 Upgrade : What you need to know

You should all read the Usage section of the webpacker docs.

https://github.com/rails/webpacker#usage NOTE: We ARE using the split chunks API.

Do

<%= stylesheet_packs_with_chunks_tag 'my_stylesheet' %>
<%= javascript_packs_with_chunks_tag 'my_js_file', 'my_other_js_file' %>

Don't

<%= stylesheet_pack_tag 'my_js_file' %>
<%= javascript_pack_tag 'my_js_file' %>
<%= javascript_pack_tag 'my_other_js_file' %>

Unexpected behavior with new packs?

Make sure that you don't have more than one reference to javascript_packs_with_chunks_tag in your templates.

❗Do this once you pull down a fresh master

You may need to update node so try this which will autoload the version in our current .rvmrc file (today that's 8.9.4).

Assuming you have nvm installed (you probably should), run these commands to confirm that you are on the correct version of node and have re-compiled things.

$ nvm install
$ nvm use
$ ./install.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment