This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +17
-11
lines changed
Expand file tree Collapse file tree 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) {
1919 require("nativescript-dev-webpack/hot")(__webpack_require__.h(), (fileName) => applicationFiles.getFile(fileName));
2020 };
2121
22- global.__hmrRefresh = function(type) {
22+ global.__hmrRefresh = function({ type, module } ) {
2323 global.__hmrNeedReload = true;
2424 setTimeout(() => {
2525 if(global.__hmrNeedReload) {
2626 global.__hmrNeedReload = false;
27- global.__hmrLivesyncBackup();
27+ global.__hmrLivesyncBackup({ type, module } );
2828 }
2929 });
3030 }
@@ -45,9 +45,9 @@ module.exports = function (source) {
4545 if ( loadCss ) {
4646 source = `
4747 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'
5151 } ")();
5252 ${ source }
5353 ` ;
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 `
23 if (module.hot) {
34 module.hot.accept();
45 module.hot.dispose(() => {
5- global.__hmrRefresh('${ type } ');
6+ global.__hmrRefresh({ type: '${ type } ', module: ' ${ module } ' } );
67 })
78 }
89` } ;
9-
Original file line number Diff line number Diff line change 11const { reload } = require ( "./hot-loader-helper" ) ;
22
33module . 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 } ) } ` ;
57} ;
Original file line number Diff line number Diff line change 11const { reload } = require ( "./hot-loader-helper" ) ;
22
33module . 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 } ) } ` ;
57} ;
Original file line number Diff line number Diff line change 11const { reload } = require ( "./hot-loader-helper" ) ;
22
33module . 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 } ) } ` ;
57} ;
You can’t perform that action at this time.
0 commit comments