@@ -302,7 +302,9 @@ var module = ({}[moduleId] = {{"#,
302302 if use_require || module_cache {
303303 header. push (
304304 format ! (
305- "// The module cache\n var {} = {{}};\n " ,
305+ r#"// The module cache
306+ var {} = {{}};
307+ "# ,
306308 runtime_template. render_runtime_variable( & RuntimeVariable :: ModuleCache )
307309 )
308310 . into ( ) ,
@@ -314,23 +316,37 @@ var module = ({}[moduleId] = {{"#,
314316 // (see MakeDeferredNamespaceObjectRuntimeModule)
315317 // This requires all deferred imports to a module can get the module export object before the module
316318 // is evaluated.
317- header. push ( "// The deferred module cache\n var __rspack_deferred_exports = {};\n " . into ( ) ) ;
319+ header. push (
320+ r#"// The deferred module cache
321+ var __rspack_deferred_exports = {};
322+ "#
323+ . into ( ) ,
324+ ) ;
318325 }
319326
320327 if use_require {
321328 header. push (
322329 format ! (
323- "// The require function\n function {}(moduleId) {{\n " ,
330+ r#"// The require function
331+ function {}(moduleId) {{
332+ "# ,
324333 runtime_template. render_runtime_globals( & RuntimeGlobals :: REQUIRE )
325334 )
326335 . into ( ) ,
327336 ) ;
328337 header. extend ( Self :: render_require ( chunk_ukey, compilation) ) ;
329- header. push ( "\n }\n " . into ( ) ) ;
338+ header. push (
339+ r#"
340+ }
341+ "#
342+ . into ( ) ,
343+ ) ;
330344 } else if require_scope_used {
331345 header. push (
332346 format ! (
333- "// The require scope\n var {} = {{}};\n " ,
347+ r#"// The require scope
348+ var {} = {{}};
349+ "# ,
334350 runtime_template. render_runtime_globals( & RuntimeGlobals :: REQUIRE )
335351 )
336352 . into ( ) ,
@@ -341,7 +357,9 @@ var module = ({}[moduleId] = {{"#,
341357 {
342358 header. push (
343359 format ! (
344- "// expose the modules object ({modules})\n {module_factories} = {modules};\n " ,
360+ r#"// expose the modules object ({modules})
361+ {module_factories} = {modules};
362+ "# ,
345363 modules = runtime_template. render_runtime_variable( & RuntimeVariable :: Modules ) ,
346364 module_factories =
347365 runtime_template. render_runtime_globals( & RuntimeGlobals :: MODULE_FACTORIES )
@@ -353,7 +371,9 @@ var module = ({}[moduleId] = {{"#,
353371 if runtime_requirements. contains ( RuntimeGlobals :: MODULE_CACHE ) {
354372 header. push (
355373 format ! (
356- "// expose the module cache\n {} = {};\n " ,
374+ r#"// expose the module cache
375+ {} = {};
376+ "# ,
357377 runtime_template. render_runtime_globals( & RuntimeGlobals :: MODULE_CACHE ) ,
358378 runtime_template. render_runtime_variable( & RuntimeVariable :: ModuleCache ) ,
359379 )
@@ -364,7 +384,9 @@ var module = ({}[moduleId] = {{"#,
364384 if intercept_module_execution {
365385 header. push (
366386 format ! (
367- "// expose the module execution interceptor\n {} = [];\n " ,
387+ r#"// expose the module execution interceptor
388+ {} = [];
389+ "# ,
368390 runtime_template. render_runtime_globals( & RuntimeGlobals :: INTERCEPT_MODULE_EXECUTION )
369391 )
370392 . into ( ) ,
@@ -581,7 +603,9 @@ var module = ({}[moduleId] = {{"#,
581603 allow_inline_startup = false ;
582604 header. push (
583605 format ! (
584- "// the startup function\n {} = {};\n " ,
606+ r#"// the startup function
607+ {} = {};
608+ "# ,
585609 runtime_template. render_runtime_globals( & RuntimeGlobals :: STARTUP ) ,
586610 compilation. runtime_template. basic_function(
587611 "" ,
@@ -610,7 +634,9 @@ var module = ({}[moduleId] = {{"#,
610634 } else if runtime_requirements. contains ( RuntimeGlobals :: STARTUP ) {
611635 header. push (
612636 format ! (
613- "// the startup function\n // It's empty as no entry modules are in this chunk\n {} = function(){{}};" ,
637+ r#"// the startup function
638+ // It's empty as no entry modules are in this chunk
639+ {} = function(){{}};"# ,
614640 runtime_template. render_runtime_globals( & RuntimeGlobals :: STARTUP )
615641 )
616642 . into ( ) ,
@@ -619,7 +645,9 @@ var module = ({}[moduleId] = {{"#,
619645 } else if runtime_requirements. contains ( RuntimeGlobals :: STARTUP ) {
620646 header. push (
621647 format ! (
622- "// the startup function\n // It's empty as some runtime module handles the default behavior\n {} = function(){{}};" ,
648+ r#"// the startup function
649+ // It's empty as some runtime module handles the default behavior
650+ {} = function(){{}};"# ,
623651 runtime_template. render_runtime_globals( & RuntimeGlobals :: STARTUP )
624652 )
625653 . into ( ) ,
0 commit comments