CrocoDillon / universal-react-redux-boilerplate

Step by step creation of a Universal React + Redux Boilerplate
Other
176 stars 33 forks source link

deployment strategy #37

Open pailhead opened 7 years ago

pailhead commented 7 years ago

After much trial and error I've been able to understand the approach to universal rendering a bit better and setup additional loaders to work correctly with isomorphic tools :)

Now i'm trying to figure out how to actually deploy it. I'm confused by the stuff in /lib and the reason to not just bundle and minify it? The entire content of that dir is overwritten with every build, and it has to be deployed every time?

CrocoDillon commented 6 years ago

The idea of /lib is a file per file mapping of /src but compiled for whichever Node version you're running. Some people just bundle their server build as well as their client build but somehow I liked it this way more. Using a bundled and minified version on the server seems unnecessary. That said, /dist is for the client and /lib for the server, both need to be deployed every time.