Skip to content
A package to help with webpacking NativeScript apps.
JavaScript TypeScript Other
Branch: master
Clone or download
Latest commit c0c285b Dec 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update PULL_REQUEST_TEMPLATE.md Nov 8, 2019
.vscode fix: don't include partial scss files in bundle (#988) Jul 16, 2019
bin chore: remove bundle flag from documentation Aug 14, 2019
build chore(prepublish): change script name; accepts --distTag option (#662) ( Sep 17, 2018
demo chore: update the webpack.config of the demo app Dec 4, 2019
hmr fix(hmr): check for hot update should not create new file Aug 14, 2019
host feat: support @NativeScript scope in host resover Oct 15, 2019
jasmine-config chore: Enable all unit test and test coverage (#1045) Sep 16, 2019
lib feat: support useLibs though env.compileSnapshot and calculate the ND… Oct 9, 2019
nativescript-target refactor(nativescript-target): add main template runtime for hot upda… Sep 5, 2018
plugins fix: bundle emitted on save without changes Nov 18, 2019
snapshot/android Merge pull request #1077 from NativeScript/tachev/macos-snapshot-docker Nov 26, 2019
templates fix: avoid duplicate modules from tns-core-modules and @nativescript/… Dec 3, 2019
transformers chore: merge release in master (#964) Jul 4, 2019
utils fix: handle correctly webpack compilation errors Sep 26, 2019
verify refactor: remove the vendor.ts/js files May 3, 2018
.gitignore test: add tests for css2json-loader Oct 23, 2019
.npmignore chore: Enable all unit test and test coverage (#1045) Sep 16, 2019
.nycrc chore: Enable all unit test and test coverage (#1045) Sep 16, 2019
CHANGELOG.md release: cut the 1.3.0 release Oct 31, 2019
CODE_OF_CONDUCT.md docs: update LICENSE and CODE_OF_CONDUCT.md (#407) Jan 23, 2018
CONTRIBUTING.md chore: remove bundle flag from documentation Aug 14, 2019
LICENSE chore: update community files (#761) Jan 7, 2019
PULL_REQUEST_TESTS.md Update PULL_REQUEST_TESTS.md (#185) Jun 9, 2017
README.md chore: remove bundle flag from documentation Aug 14, 2019
android-app-components-loader.js fix: typescript source maps are containing javascript code (#857) Apr 12, 2019
androidProjectHelpers.js chore: fix PR comments Oct 10, 2019
apply-css-loader.js refactor: add check for css-loader Oct 25, 2019
bundle-config-loader.spec.ts fix: exclude files from tests folder from built application Oct 2, 2019
bundle-config-loader.ts fix: stop ignoring the initial hot updates Oct 29, 2019
css2json-loader.spec.ts fix: fix module import of local css files Nov 21, 2019
css2json-loader.ts fix: fix module import of local css files Nov 21, 2019
dependencyManager.js feat: update to angular 8.2 Aug 14, 2019
hot-loader-helper.js refactor(HMR): rename module to path in context object (#787) Feb 4, 2019
hot.js fix(hmr): check for hot update should not create new file Aug 14, 2019
index.js fix: avoid duplicate modules from tns-core-modules and @nativescript/… Dec 3, 2019
index.spec.ts fix: vue template crashes on start (#997) Jul 22, 2019
installer.js refactor: remove the vendor.ts/js files May 3, 2018
lazy-ngmodule-hot-loader.js fix: lazy-ngmodule-hot-loader breaks the sourceMaps (#770) Jan 25, 2019
load-application-css-angular.js fix: register non-relative app.css module Aug 8, 2019
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
markup-hot-loader.js fix: typescript source maps are containing javascript code (#857) Apr 12, 2019
merge-guidance-schema.png docs: update release schema Mar 15, 2019
moduleid-compat-loader.js refactor: Refactor moduleId: __filename to moduleId: module.id, imple… Dec 12, 2017
package.json fix: update worker loader in order to fix HMR Nov 29, 2019
postinstall.js chore: merge release in master (#964) Jul 4, 2019
preuninstall.js chore: merge release in master (#964) Jul 4, 2019
projectFilesManager.js fix(update-ns-webpack): skip the update of tsconfig.tns.json in… (#1001) Aug 1, 2019
projectHelpers.js fix(update-ns-webpack): skip the update of tsconfig.tns.json in… (#1001) Aug 1, 2019
projectHelpers.spec.js fix(Angular): add hot loader for lazy loaded NgModules (#747) Dec 18, 2018
release-contribution-guide-schema-webpack.png docs: update release schema Mar 15, 2019
script-hot-loader.js fix: typescript source maps are containing javascript code (#857) Apr 12, 2019
style-hot-loader.js fix: typescript source maps are containing javascript code (#857) Apr 12, 2019
tsconfig.json refactor: simplify TS configuration Aug 23, 2018
unit-testing-config-loader.js fix: fix the execution of unit tests with latest unit-test-runner and… Jul 10, 2019
xml-namespace-loader.spec.ts refactor: emit warning for invalid & in XML (#1059) Oct 2, 2019
xml-namespace-loader.ts refactor: emit warning for invalid & in XML (#1059) Oct 2, 2019

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
or
$ tns run ios

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 Stack Overflow or ask our experts in NativeScript community Slack channel.

You can’t perform that action at this time.