This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 11import * as hot from "../hot" ;
2- import { knownFolders } from "tns-core-modules/file-system" ;
2+ import { knownFolders , path , File } from "tns-core-modules/file-system" ;
33
44declare const __webpack_require__ : any ;
55
66export function hmrUpdate ( ) {
7- const applicationFiles = knownFolders . currentApp ( ) ;
7+ const currentAppFolder = knownFolders . currentApp ( ) ;
88 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+ } ) ;
1013}
Original file line number Diff line number Diff line change @@ -147,6 +147,10 @@ function update(latestHash, options) {
147147
148148function getNextHash ( hash , getFileContent ) {
149149 const file = getFileContent ( `${ hash } .hot-update.json` ) ;
150+ if ( ! file ) {
151+ return Promise . resolve ( hash ) ;
152+ }
153+
150154 return file . readText ( ) . then ( hotUpdateContent => {
151155 if ( hotUpdateContent ) {
152156 const manifest = JSON . parse ( hotUpdateContent ) ;
You can’t perform that action at this time.
0 commit comments