This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
import * as hot from "../hot" ;
2
- import { knownFolders } from "tns-core-modules/file-system" ;
2
+ import { knownFolders , path , File } from "tns-core-modules/file-system" ;
3
3
4
4
declare const __webpack_require__ : any ;
5
5
6
6
export function hmrUpdate ( ) {
7
- const applicationFiles = knownFolders . currentApp ( ) ;
7
+ const currentAppFolder = knownFolders . currentApp ( ) ;
8
8
const latestHash = __webpack_require__ [ "h" ] ( ) ;
9
- return hot ( latestHash , filename => applicationFiles . getFile ( filename ) ) ;
9
+ return hot ( latestHash , filename => {
10
+ const fullFilePath = path . join ( currentAppFolder . path , filename ) ;
11
+ return File . exists ( fullFilePath ) ? currentAppFolder . getFile ( filename ) : null ;
12
+ } ) ;
10
13
}
Original file line number Diff line number Diff line change @@ -147,6 +147,10 @@ function update(latestHash, options) {
147
147
148
148
function getNextHash ( hash , getFileContent ) {
149
149
const file = getFileContent ( `${ hash } .hot-update.json` ) ;
150
+ if ( ! file ) {
151
+ return Promise . resolve ( hash ) ;
152
+ }
153
+
150
154
return file . readText ( ) . then ( hotUpdateContent => {
151
155
if ( hotUpdateContent ) {
152
156
const manifest = JSON . parse ( hotUpdateContent ) ;
You can’t perform that action at this time.
0 commit comments