This course has been updated! We now recommend you take the Complete Intro to React, v7 course.
Transcript from the "Code Splitting with Webpack" Lesson
>> Brian Holt: So I just reverted all my code back to using the death server. The one thing I wanted to go with capture in my package.json is the ability to run that server. So I'm gonna call this start.
>> Brian Holt: And then I'm gonna say, NODE_ENV=server node server.js. So now that if I say yarn start it'll start my production server, right.
>> Brian Holt: So again I can just come in here and say, yarn start, and it should be good to go.
>> Brian Holt: So yeah, you just have to make sure to not include hot module refresh, or it's gonna have a bad time.
>> Brian Holt: So I'm gonna change this back from watch to dev, so I can go back to the development server.
>> Brian Holt: So we're gonna talk about another thing here called code splitting, or chunking as it used to be called.
>> Brian Holt: There's a kind of a weird problem in particular doing server-side rendering, hot module replacement and code splitting all at once. It's a pick two scenario that the three cannot coexist all together given these state of how webpack works.
[00:02:17] Which is gonna be again another performance win for us. This is again something that you're wanna to do in production. Maybe not in development because there's no real reason that you need to be doing that in development.