@@ -37,6 +37,7 @@ Stats.prototype.toJson = function toJson(options, forToString) {
3737 var showChildren = d ( options . children , true ) ;
3838 var showSource = d ( options . source , ! forToString ) ;
3939 var showErrorDetails = d ( options . errorDetails , ! forToString ) ;
40+ var showPublicPath = d ( options . publicPath , ! forToString ) ;
4041 var excludeModules = [ ] . concat ( d ( options . exclude , [ ] ) ) . map ( function ( str ) {
4142 if ( typeof str !== "string" ) return str ;
4243 return new RegExp ( "[\\\\/]" + str . replace ( / [ \- \[ \] \/ \{ \} \( \) \* \+ \? \. \\ \^ \$ \| ] / g, "\\$&" ) + "([\\\\/]|$|!|\\?)" ) ;
@@ -108,6 +109,11 @@ Stats.prototype.toJson = function toJson(options, forToString) {
108109 if ( showTimings && this . startTime && this . endTime ) {
109110 obj . time = this . endTime - this . startTime ;
110111 }
112+ if ( showPublicPath ) {
113+ obj . publicPath = this . compilation . mainTemplate . getPublicPath ( {
114+ hash : this . compilation . renderedHash
115+ } ) ;
116+ }
111117 if ( showAssets ) {
112118 var assetsByFile = { } ;
113119 obj . assetsByChunkName = { } ;
@@ -365,6 +371,11 @@ Stats.jsonToString = function jsonToString(obj, useColors) {
365371 normal ( "ms" ) ;
366372 newline ( ) ;
367373 }
374+ if ( obj . publicPath ) {
375+ normal ( "PublicPath: " )
376+ bold ( obj . publicPath ) ;
377+ newline ( ) ;
378+ }
368379 if ( obj . assets && obj . assets . length > 0 ) {
369380 var t = [ [ "Asset" , "Size" , "Chunks" , "" , "Chunk Names" ] ]
370381 obj . assets . forEach ( function ( asset ) {
0 commit comments