44*/
55var ConcatSource = require ( "webpack-core/lib/ConcatSource" ) ;
66var OriginalSource = require ( "webpack-core/lib/OriginalSource" ) ;
7+ var PrefixSource = require ( "webpack-core/lib/PrefixSource" ) ;
78var Template = require ( "./Template" ) ;
89
910function MainTemplate ( outputOptions ) {
@@ -27,11 +28,14 @@ MainTemplate.prototype.render = function(hash, chunk, moduleTemplate, dependency
2728 buf . push ( "" ) ;
2829 buf . push ( "// Load entry module and return exports" ) ;
2930 buf . push ( "return " + this . requireFn + "(0);" ) ;
30- var bootstrapSource = new OriginalSource ( this . indent ( buf ) , "webpackBootstrap " + hash ) ;
31- var source = new ConcatSource ( "(function(modules) { // webpackBootstrap\n" , bootstrapSource , "\n})\n" ) ;
31+ var source = new ConcatSource ( ) ;
32+ source . add ( "/******/(function(modules) { // webpackBootstrap\n" ) ;
33+ source . add ( new PrefixSource ( "/******/\t" , new OriginalSource ( this . asString ( buf ) , "webpackBootstrap " + hash ) ) ) ;
34+ source . add ( "\n/******/})\n" ) ;
3235 source . add ( "/************************************************************************/\n" ) ;
3336 source . add ( "({\n" ) ;
3437 source . add ( this . asString ( this . renderInitModules ( hash , chunk , moduleTemplate , dependencyTemplates ) ) ) ;
38+ source . add ( "\n" ) ;
3539 chunk . modules . forEach ( function ( module , idx ) {
3640 if ( idx != 0 ) source . add ( ",\n" ) ;
3741 source . add ( "\n/***/ " + module . id + ":\n" ) ;
@@ -128,7 +132,7 @@ MainTemplate.prototype.renderInit = function(hash, chunk) {
128132MainTemplate . prototype . renderInitModules = function ( hash , chunk , moduleTemplate , dependencyTemplates ) {
129133 var publicPath = this . outputOptions . publicPath || "" ;
130134 return [
131- "// __webpack_public_path__\n " ,
135+ "// __webpack_public_path__" ,
132136 "c: " + JSON . stringify ( publicPath . replace ( Template . REGEXP_HASH , hash ) ) + ","
133137 ] ;
134138} ;
0 commit comments