@@ -28,7 +28,7 @@ import {
2828 getStatsConfig ,
2929 getStylesConfig ,
3030} from '../webpack/configs' ;
31- import { createWebpackLoggingCallback } from '../webpack/utils/stats' ;
31+ import { webpackStatsLogger } from '../webpack/utils/stats' ;
3232import { Schema as ServerBuilderOptions } from './schema' ;
3333
3434// If success is true, outputPath should be set.
@@ -85,34 +85,39 @@ export function execute(
8585 concatMap ( ( { config, i18n } ) => {
8686 return runWebpack ( config , context , {
8787 webpackFactory : require ( 'webpack' ) as typeof webpack ,
88- logging : createWebpackLoggingCallback ( ! ! options . verbose , context . logger ) ,
88+ logging : ( stats , config ) => {
89+ if ( options . verbose ) {
90+ context . logger . info ( stats . toString ( config . stats ) ) ;
91+ }
92+ } ,
8993 } ) . pipe (
9094 concatMap ( async output => {
9195 const { emittedFiles = [ ] , webpackStats } = output ;
92- if ( ! output . success || ! i18n . shouldInline ) {
93- return output ;
94- }
95-
9696 if ( ! webpackStats ) {
9797 throw new Error ( 'Webpack stats build result is required.' ) ;
9898 }
9999
100- outputPaths = ensureOutputPaths ( baseOutputPath , i18n ) ;
101-
102- const success = await i18nInlineEmittedFiles (
103- context ,
104- emittedFiles ,
105- i18n ,
106- baseOutputPath ,
107- Array . from ( outputPaths . values ( ) ) ,
108- [ ] ,
109- // tslint:disable-next-line: no-non-null-assertion
110- webpackStats . outputPath ! ,
111- target <= ScriptTarget . ES5 ,
112- options . i18nMissingTranslation ,
113- ) ;
114-
115- return { output, success } ;
100+ let success = output . success ;
101+ if ( success && i18n . shouldInline ) {
102+ outputPaths = ensureOutputPaths ( baseOutputPath , i18n ) ;
103+
104+ success = await i18nInlineEmittedFiles (
105+ context ,
106+ emittedFiles ,
107+ i18n ,
108+ baseOutputPath ,
109+ Array . from ( outputPaths . values ( ) ) ,
110+ [ ] ,
111+ // tslint:disable-next-line: no-non-null-assertion
112+ webpackStats . outputPath ! ,
113+ target <= ScriptTarget . ES5 ,
114+ options . i18nMissingTranslation ,
115+ ) ;
116+ }
117+
118+ webpackStatsLogger ( context . logger , webpackStats , config ) ;
119+
120+ return { ...output , success } ;
116121 } ) ,
117122 ) ;
118123 } ) ,
0 commit comments