mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
14 lines
482 B
TypeScript
14 lines
482 B
TypeScript
import * as hot from '../helpers/hot';
|
|
|
|
declare const __webpack_require__: any;
|
|
|
|
export function hmrUpdate() {
|
|
const coreFile = require('@nativescript/core');
|
|
const currentAppFolder = coreFile.knownFolders.currentApp();
|
|
const latestHash = __webpack_require__['h']();
|
|
return hot(latestHash, (filename) => {
|
|
const fullFilePath = coreFile.path.join(currentAppFolder.path, filename);
|
|
return coreFile.File.exists(fullFilePath) ? currentAppFolder.getFile(filename) : null;
|
|
});
|
|
}
|