How to use Webpack in Development


#1

I have followed along the guidance on using webpack, uglify, and angular ahead of time here: https://docs.nativescript.org/angular/best-practices/startup-times .

Following this guidance, I used the following command to start up the app on my device for testing:
$ tns run ios --bundle --env.uglify --env.aot

The early results of using webpack and these other tools was great–the app size shrunk dramatically, and the app was fast.

But afterward, subsequent builds have taken a lot longer (and seem to exit out more).

Is this standard?

For example, after having run that command above ($ tns run ios --bundle --env.uglify --env.aot), do I still use it each time after I want to re-start the app to test it out?

I first used the command yesterday, and now it seems like now the build is really slow–in fact, it now seems extra slow whether I use that command or just the standard $ tns run ios, and whether I am testing on the device or emulator.


#2

I’m still interested in the best way to use webpack in development (should you run the webpack $ tns run command each build, or does running it once do the job?). But I think the problem I was having with builds crashing out was not because of webpack, but because of a caching plugin I was using that doesn’t seem fully updated for NS 4.1+.

Discussion about that here:Speed Up Remote Image Load?