Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nativescript): 5.2 updates #87

Merged
merged 1 commit into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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