1 | # NativeScript Webpack
|
2 |
|
3 | This repository contains the code for the nativescript-dev-webpack plugin which helps in webpacking [NativeScript](https://www.nativescript.org/) apps.
|
4 |
|
5 | JavaScript code and general asset bundling have been a member of the web developer toolbox for a long time. Tools like Webpack have been providing support for an enjoyable development experience that lets you assemble client-side code from various module sources and formats and then package it together. Most importantly, they allow for page load time optimizations that reduce or parallelize the number of requests a browser makes to the server.
|
6 |
|
7 | Why bundle scripts in a mobile app though?
|
8 |
|
9 | - Fewer filesystem operations on app startup
|
10 | - Smaller code size
|
11 | - Tree-shaking
|
12 | - Preprocessing and interoperability hooks. Webpack provides a way to resolve modules and expressions differently according to its configuration. It also contains a lot of plugins and loaders that let you embed different content in your application or use code written in different programming languages
|
13 |
|
14 | For more details, see the [NativeScript docs for building with webpack](http://docs.nativescript.org/angular/best-practices/bundling-with-webpack.html).
|
15 |
|
16 |
|
17 |
|
18 | - [Ingredients](#ingredients)
|
19 | - [Usage](#usage)
|
20 | - [Contribute](#contribute)
|
21 | - [Get Help](#get-help)
|
22 |
|
23 |
|
24 |
|
25 | ## Ingredients
|
26 |
|
27 | * webpack config templates.
|
28 | * helper functions that place files at the correct locations before packaging apps.
|
29 | * loaders and plugins for vanilla NativeScript and Angular apps.
|
30 |
|
31 | ## Usage
|
32 |
|
33 | ```sh
|
34 | $ npm install --save-dev nativescript-dev-webpack
|
35 |
|
36 | $ tns run android --bundle
|
37 | or
|
38 | $ tns run ios --bundle
|
39 | ```
|
40 |
|
41 | ## Contribute
|
42 | We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md) and [instructions for local setup](https://github.com/NativeScript/nativescript-dev-webpack/blob/master/CONTRIBUTING.md#setup). If you want to contribute, but you are not sure where to start - look for [issues labeled `help wanted`](https://github.com/NativeScript/nativescript-dev-webpack/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
|
43 |
|
44 | ## Get Help
|
45 | Please, use [github issues](https://github.com/NativeScript/nativescript-dev-webpack/issues) strictly for [reporting bugs](CONTRIBUTING.md#reporting-bugs) or [requesting features](CONTRIBUTING.md#requesting-features). For general questions and support, check out [Stack Overflow](https://stackoverflow.com/questions/tagged/nativescript) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation).
|
46 |
|
47 | ![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/nativescript-dev-webpack?pixel)
|
48 |
|
49 |
|