This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree 5 files changed +17
-11
lines changed
5 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ module.exports = function (source) {
19
19
require("nativescript-dev-webpack/hot")(__webpack_require__.h(), (fileName) => applicationFiles.getFile(fileName));
20
20
};
21
21
22
- global.__hmrRefresh = function(type) {
22
+ global.__hmrRefresh = function({ type, module } ) {
23
23
global.__hmrNeedReload = true;
24
24
setTimeout(() => {
25
25
if(global.__hmrNeedReload) {
26
26
global.__hmrNeedReload = false;
27
- global.__hmrLivesyncBackup();
27
+ global.__hmrLivesyncBackup({ type, module } );
28
28
}
29
29
});
30
30
}
@@ -45,9 +45,9 @@ module.exports = function (source) {
45
45
if ( loadCss ) {
46
46
source = `
47
47
require("${
48
- angular ?
49
- 'nativescript-dev-webpack/load-application-css-angular' :
50
- 'nativescript-dev-webpack/load-application-css-regular'
48
+ angular ?
49
+ 'nativescript-dev-webpack/load-application-css-angular' :
50
+ 'nativescript-dev-webpack/load-application-css-regular'
51
51
} ")();
52
52
${ source }
53
53
` ;
Original file line number Diff line number Diff line change 1
- module . exports . reload = function ( type ) { return `
1
+ module . exports . reload = function ( { type, module } ) {
2
+ return `
2
3
if (module.hot) {
3
4
module.hot.accept();
4
5
module.hot.dispose(() => {
5
- global.__hmrRefresh('${ type } ');
6
+ global.__hmrRefresh({ type: '${ type } ', module: ' ${ module } ' } );
6
7
})
7
8
}
8
9
` } ;
9
-
Original file line number Diff line number Diff line change 1
1
const { reload } = require ( "./hot-loader-helper" ) ;
2
2
3
3
module . exports = function ( source ) {
4
- return `${ source } ;${ reload ( 'markup' ) } ` ;
4
+ const typeMarkup = "markup" ;
5
+ const modulePath = this . resourcePath . replace ( this . context , "." ) ;
6
+ return `${ source } ;${ reload ( { type : typeMarkup , module : modulePath } ) } ` ;
5
7
} ;
Original file line number Diff line number Diff line change 1
1
const { reload } = require ( "./hot-loader-helper" ) ;
2
2
3
3
module . exports = function ( source ) {
4
- return `${ source } ;${ reload ( 'script' ) } ` ;
4
+ const typeScript = "script" ;
5
+ const modulePath = this . resourcePath . replace ( this . context , "." ) ;
6
+ return `${ source } ;${ reload ( { type : typeScript , module : modulePath } ) } ` ;
5
7
} ;
Original file line number Diff line number Diff line change 1
1
const { reload } = require ( "./hot-loader-helper" ) ;
2
2
3
3
module . exports = function ( source ) {
4
- return `${ source } ;${ reload ( 'style' ) } ` ;
4
+ const typeStyle = "style" ;
5
+ const modulePath = this . resourcePath . replace ( this . context , "." ) ;
6
+ return `${ source } ;${ reload ( { type : typeStyle , module : modulePath } ) } ` ;
5
7
} ;
You can’t perform that action at this time.
0 commit comments