This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ var extractTextPluginHmrRuntime = require.resolve("./hotModuleReplacement.js");
14
14
module . exports = function ( source ) {
15
15
if ( this . cacheable ) this . cacheable ( ) ;
16
16
// Even though this gets overwritten if extract+remove are true, without it, the runtime doesn't get added to the chunk
17
- return "if (module.hot){ require('" + extractTextPluginHmrRuntime + " ');}\n" + source ;
17
+ return `if (module.hot) { require('${ extractTextPluginHmrRuntime } '); }\n${ source } ` ;
18
18
} ;
19
19
module . exports . pitch = function ( request ) {
20
20
if ( this . cacheable ) this . cacheable ( ) ;
@@ -114,7 +114,13 @@ module.exports.pitch = function(request) {
114
114
resultSource += "\nmodule.exports = " + JSON . stringify ( text . locals ) + ";" ;
115
115
}
116
116
// module.hot.data is undefined on initial load, and an object in hot updates
117
- resultSource += "\nif(module.hot){\nmodule.hot.accept();\nif(module.hot.data){\nrequire('" + extractTextPluginHmrRuntime + "')('%%extracted-hash%%','" + publicPath + "','%%extracted-file%%');\n}\n}" ;
117
+ resultSource += `
118
+ if (module.hot) {
119
+ module.hot.accept();
120
+ if (module.hot.data) {
121
+ require('${ extractTextPluginHmrRuntime } ')('%%extracted-hash%%','${ publicPath } ','%%extracted-file%%');
122
+ }
123
+ }` ;
118
124
}
119
125
} catch ( e ) {
120
126
return callback ( e ) ;
You can’t perform that action at this time.
0 commit comments