JavaScript TypeScript Other
Clone or download
sis0k0 refactor(angular): provide mainPath instead of entryModule to ng comp…
…iler plugin (#633)

The entryModule path can differ depending on what kind of project you're
using - mobile or web+mobile. While the best solution is to get the
mainPath from angular.json, not all {N} projects have that file. We'll
stick to the standard for web and web+mobile location - `appPath/main.ts`.

**Note** - We'll have to update {N} schematics to reflect this change.
Latest commit 42b0c0b Aug 14, 2018
Permalink
Failed to load latest commit information.
.github docs: add PR and ISSUE templates (#453) Mar 8, 2018
.vscode refactor(debugging): Add vscode launch options to allow debugging the… Dec 20, 2017
bin refactor: use webpack context when notifying CLI for changed files (#455 Mar 10, 2018
build chore(travis): publish next version (#192) Jun 19, 2017
demo chore: update demos inherit from supportlib activity (#624) Aug 7, 2018
host fix(angular): use hostReplacementPaths function instead of host (#615) Jul 19, 2018
lib refactor: generate source maps when running `tns debug --bundle` (#617) Jul 24, 2018
nativescript-target refactor: update webpack plugins to new plugin system (#523) May 15, 2018
plugins fix: tell the {N} CLI to ignore the source dir when watching for chan… Jun 25, 2018
snapshot/android refactor: remove android-runtime 3.4< specific code (#520) May 15, 2018
templates refactor(angular): provide mainPath instead of entryModule to ng comp… Aug 14, 2018
verify refactor: remove the vendor.ts/js files May 3, 2018
.gitignore fix(angular): use hostReplacementPaths function instead of host (#615) Jul 19, 2018
.npmignore fix(angular): use hostReplacementPaths function instead of host (#615) Jul 19, 2018
CHANGELOG.md release: cut the 0.15.1 release (#626) Aug 7, 2018
CODE_OF_CONDUCT.md docs: update LICENSE and CODE_OF_CONDUCT.md (#407) Jan 23, 2018
CONTRIBUTING.md chore(demos): update dependencies (#597) Jul 17, 2018
LICENSE chore: update community files Jun 5, 2018
PULL_REQUEST_TESTS.md Update PULL_REQUEST_TESTS.md (#185) Jun 9, 2017
README.md chore: update readme and contributing guide (#434) Feb 14, 2018
android-app-components-loader.js fix: resolve appComponents and xml namespaces absolute paths on Windo… Jun 26, 2018
androidProjectHelpers.js refactor: remove android-runtime 3.4< specific code (#520) May 15, 2018
bundle-config-loader.js feat: add setting for plain modules regex (#582) Jun 25, 2018
css2json-loader.js Add FS, PlatformSuffixPlugin and css2json-loader (#290) Nov 9, 2017
dependencyManager.js chore: bump version to official Angular CLI 6.1 (#621) Jul 26, 2018
index.js fix(angular): use hostReplacementPaths function instead of host (#615) Jul 19, 2018
installer.js refactor: remove the vendor.ts/js files May 3, 2018
load-application-css-angular.js fix(AoT): stop using require.context in Angular apps (#574) Jun 22, 2018
load-application-css-regular.js fix(AoT): stop using require.context in Angular apps (#574) Jun 22, 2018
load-application-css.js fix(AoT): stop using require.context in Angular apps (#574) Jun 22, 2018
moduleid-compat-loader.js refactor: Refactor moduleId: __filename to moduleId: module.id, imple… Dec 12, 2017
package.json release: cut the 0.15.1 release (#626) Aug 7, 2018
postinstall.js Compare webpack.config files (#485) Apr 5, 2018
projectFilesManager.js fix-next: add tsconfig.esm.json to TS projects (#519) May 15, 2018
projectHelpers.js fix: resolve appComponents and xml namespaces absolute paths on Windo… Jun 26, 2018
tsconfig.json fix(angular): use hostReplacementPaths function instead of host (#615) Jul 19, 2018
xml-namespace-loader.js feat(xml-namespace-loader): add ignore option (#605) Jul 23, 2018

README.md

NativeScript Webpack

This repository contains the code for the nativescript-dev-webpack plugin which helps in webpacking NativeScript apps.

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.

Why bundle scripts in a mobile app though?

  • Fewer filesystem operations on app startup
  • Smaller code size
  • Tree-shaking
  • 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

For more details, see the NativeScript docs for building with webpack.

Ingredients

  • webpack config templates.
  • helper functions that place files at the correct locations before packaging apps.
  • loaders and plugins for vanilla NativeScript and Angular apps.

Usage

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

$ tns run android --bundle
or
$ tns run ios --bundle

Contribute

We love PRs! Check out the contributing guidelines and instructions for local setup. If you want to contribute, but you are not sure where to start - look for issues labeled help wanted.

Get Help

Please, use github issues strictly for reporting bugs or requesting features. For general questions and support, check out the NativeScript community forum or ask our experts in NativeScript community Slack channel.