Webpack 4 Fundamentals Adding Watch Mode
Transcript from the "Adding Watch Mode" Lesson
>> Sean Larkin: I don't want to have to force anybody to have to run mpm run prod a thousand times and so, why don't we jump back into our scripts. We can solve this. Webpack has a watching mode and so, maybe it makes sense for our development mode, that we just have a watch flag added on.
[00:00:20] What's cool is that guess what, we just have to compose the watch flag onto the end of our DevScript.
>> Speaker 2: Does the order matter there?
>> Sean Larkin: It does not.
>> Sean Larkin: So if we say that npm run dev,
>> Sean Larkin: All right, the process doesn't exit and it just shows this feedback.
[00:00:47] But what's great now is why don't we even just jump into nav, what if we wanted to change this? What if we wanted to instead have it be a function that calls and returns the string literal nav. [LAUGH] Now of course, our code would look a little different, so if this is a function that returns a nav string, that means we now have to call nav if we wanna get the string back, right?
[00:01:16] But you can see slowly in your terminal feedback as you're changing that. So, let me see if I can get both of them up in the same, both files. It'll be helpful. Oops.
>> Sean Larkin: There we go. But as you make changes, web pack is just incrementally compiling. It just changes whatever modules you're working with.