O'Reilly logo

NativeScript for Angular Mobile Development by Nathanael J. Anderson, Nathan Walker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Preparing to use webpack

Let's take a look at how webpack can be utilized to reduce the packaged size of our NativeScript for Angular app in addition to ensuring that it executes optimally on a user's mobile device.

Let's first install the plugin:

npm install nativescript-dev-webpack --save-dev

This automatically creates a webpack.config.js file (at root of project) preconfigured with a basic setup that will get you reasonably further with most apps. Additionally, it creates a tsconfig.aot.json file (also at root of project) since NativeScript's webpack usage will use Angular's AoT compiler while bundling. It also adds some nifty npm scripts to our package.json to help handle all the various bundling options we will want; consider the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required