Skip to content

Commit

Permalink
feat(nativescript): 5.2 updates (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker authored Feb 27, 2019
1 parent 0480764 commit 802f8c5
Show file tree
Hide file tree
Showing 6 changed files with 399 additions and 306 deletions.
24 changes: 1 addition & 23 deletions src/app.nativescript/_files/app/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// https://github.com/NativeScript/nativescript-dev-webpack/issues/660#issuecomment-422711983
import 'reflect-metadata';
import { platformNativeScriptDynamic } from 'nativescript-angular/platform';
import { AppOptions } from 'nativescript-angular/platform-common';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

Expand All @@ -11,25 +10,4 @@ if (typeof __UGLIFIED__ !== 'undefined' && __UGLIFIED__) {
require('@angular/core').enableProdMode();
}

let options: AppOptions = {};
if (module['hot']) {
<% if (routing || sample) { %>
// attach to livesync hooks and perform navigation
require('@<%= npmScope %>/nativescript').attachLivesyncNavigation();
<% } %>
const hmrUpdate = require('nativescript-dev-webpack/hmr').hmrUpdate;

options.hmrOptions = {
moduleTypeFactory: () => AppModule,
livesyncCallback: platformReboot => {
console.log('HMR: Sync...');
hmrUpdate();
setTimeout(platformReboot, 0);
}
};
hmrUpdate();

module['hot'].accept(['./app.module']);
}

platformNativeScriptDynamic(options).bootstrapModule(AppModule);
platformNativeScriptDynamic().bootstrapModule(AppModule);
8 changes: 4 additions & 4 deletions src/app.nativescript/_files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core",
"reflect-metadata": "file:../../node_modules/reflect-metadata",
"rxjs": "file:../../node_modules/rxjs",
"rxjs-compat": "file:../../node_modules/rxjs-compat",
"tns-core-modules": "file:../../node_modules/tns-core-modules",
"zone.js": "file:../../node_modules/zone.js"
},
"devDependencies": {
"@angular/compiler-cli": "~7.1.0",
"@angular/compiler-cli": "~7.2.0",
"@angular/language-service": "file:../../node_modules/@angular/language-service",
"@ngtools/webpack": "~7.1.0",
"@ngtools/webpack": "~7.2.0",
"codelyzer": "file:../../node_modules/codelyzer",
"nativescript-dev-webpack": "~0.18.0",
"nativescript-dev-webpack": "~0.20.0",
"terser-webpack-plugin": "file:../../node_modules/terser-webpack-plugin",
"tns-platform-declarations": "file:../../node_modules/tns-platform-declarations",
"typescript": "file:../../node_modules/typescript"
}
Expand Down
Loading

0 comments on commit 802f8c5

Please sign in to comment.