Webpack Tips

Where do I learn about advanced Webpack setups, such as with "CSS Modules", "Code Splitting", etc

You can try out example app, shakacode/react-webpack-rails-tutorial. We're building comprehensive production examples in our new, premium product, React on Rails Pro. If you're interested, please see the details in this forum post.

Webpack v1 or v2?

We recommend using Webpack version 2.3.1 or greater.

yarn or npm?

Yarn is the current recommendation!

Entry Points

You should ensure you configure the entry points correctly for webpack if you want to break out libraries into a "vendor" bundle where your libraries are packaged separately from your app's code. If you send web clients your vendor bundle separately from your app bundles, then web clients might have the vendor bundle cached while they receive updates for your app.

Webpack v2 makes this very convenient! See:

Webpack v4

Webpack v4 is heartily recommended. If you need help with migrating your project to Webpack v4, please contact me, [email protected].

results matching ""

    No results matching ""