erikras / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform
MIT License
12.01k stars 2.5k forks source link

correct way to handle path change between webpack and rails #1264

Open chrisdobler opened 7 years ago

chrisdobler commented 7 years ago

Hey guys, I am currently working with this project https://github.com/spark-solutions/spark-starter-kit which is heavily inspired by your project. One issue I'm having is that I can't figure out how to correctly handle the issue between the rails path and the webpack path for assets.

For example in webpack dev server the path is loaded successfully like this: http://localhost:3500/6b4fec0f21ce52aebc80204c2d5c4849.png

but when you try to load it up in production it no longer works because the rails path is: http://localhost:3000/assets/6b4fec0f21ce52aebc80204c2d5c4849.png

but its still trying to load the path like this: http://localhost:3000/6b4fec0f21ce52aebc80204c2d5c4849.png

which yields a 404.

Thank you!