@@ -40,13 +40,13 @@ class JsonpMainTemplatePlugin {
4040 this . indent ( `script.setAttribute("nonce", ${ this . requireFn } .nc);` ) ,
4141 "}" ,
4242 `script.src = ${ this . requireFn } .p + ${ this . applyPluginsWaterfall ( "asset-path" , JSON . stringify ( chunkFilename ) , {
43- hash : "\" + " + this . renderCurrentHashCode ( hash ) + " + \"" ,
44- hashWithLength : length => "\" + " + this . renderCurrentHashCode ( hash , length ) + " + \"" ,
43+ hash : `" + ${ this . renderCurrentHashCode ( hash ) } + "` ,
44+ hashWithLength : length => `" + ${ this . renderCurrentHashCode ( hash , length ) } + "` ,
4545 chunk : {
4646 id : "\" + chunkId + \"" ,
47- hash : "\" + " + JSON . stringify ( chunkMaps . hash ) + " [chunkId] + \"" ,
47+ hash : `" + ${ JSON . stringify ( chunkMaps . hash ) } [chunkId] + "` ,
4848 hashWithLength ( length ) {
49- const shortChunkHashMap = { } ;
49+ const shortChunkHashMap = Object . create ( null ) ;
5050 Object . keys ( chunkMaps . hash ) . forEach ( chunkId => {
5151 if ( typeof chunkMaps . hash [ chunkId ] === "string" )
5252 shortChunkHashMap [ chunkId ] = chunkMaps . hash [ chunkId ] . substr ( 0 , length ) ;
@@ -56,7 +56,7 @@ class JsonpMainTemplatePlugin {
5656 name : "\" + (" + JSON . stringify ( chunkMaps . name ) + "[chunkId]||chunkId) + \""
5757 }
5858 } ) } ;`,
59- " var timeout = setTimeout(onScriptComplete, " + chunkLoadTimeout + ");" ,
59+ ` var timeout = setTimeout(onScriptComplete, ${ chunkLoadTimeout } );` ,
6060 "script.onerror = script.onload = onScriptComplete;" ,
6161 "function onScriptComplete() {" ,
6262 this . indent ( [
@@ -111,7 +111,7 @@ class JsonpMainTemplatePlugin {
111111 source ,
112112 "" ,
113113 "// on error function for async loading" ,
114- this . requireFn + " .oe = function(err) { console.error(err); throw err; };"
114+ ` ${ this . requireFn } .oe = function(err) { console.error(err); throw err; };`
115115 ] ) ;
116116 } ) ;
117117 mainTemplate . plugin ( "bootstrap" , function ( source , chunk , hash ) {
@@ -121,8 +121,8 @@ class JsonpMainTemplatePlugin {
121121 source ,
122122 "" ,
123123 "// install a JSONP callback for chunk loading" ,
124- " var parentJsonpFunction = window[" + JSON . stringify ( jsonpFunction ) + "];" ,
125- " window[" + JSON . stringify ( jsonpFunction ) + " ] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {" ,
124+ ` var parentJsonpFunction = window[${ JSON . stringify ( jsonpFunction ) } ];` ,
125+ ` window[${ JSON . stringify ( jsonpFunction ) } ] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {` ,
126126 this . indent ( [
127127 "// add \"moreModules\" to the modules object," ,
128128 "// then flag all \"chunkIds\" as loaded and fire callback" ,
@@ -149,7 +149,7 @@ class JsonpMainTemplatePlugin {
149149 "if(executeModules) {" ,
150150 this . indent ( [
151151 "for(i=0; i < executeModules.length; i++) {" ,
152- this . indent ( " result = " + this . requireFn + "(" + this . requireFn + " .s = executeModules[i]);" ) ,
152+ this . indent ( ` result = ${ this . requireFn } ( ${ this . requireFn } .s = executeModules[i]);` ) ,
153153 "}"
154154 ] ) ,
155155 "}" ,
0 commit comments