@@ -28,7 +28,7 @@ import {
28
28
getStatsConfig ,
29
29
getStylesConfig ,
30
30
} from '../webpack/configs' ;
31
- import { createWebpackLoggingCallback } from '../webpack/utils/stats' ;
31
+ import { webpackStatsLogger } from '../webpack/utils/stats' ;
32
32
import { Schema as ServerBuilderOptions } from './schema' ;
33
33
34
34
// If success is true, outputPath should be set.
@@ -85,34 +85,39 @@ export function execute(
85
85
concatMap ( ( { config, i18n } ) => {
86
86
return runWebpack ( config , context , {
87
87
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
+ } ,
89
93
} ) . pipe (
90
94
concatMap ( async output => {
91
95
const { emittedFiles = [ ] , webpackStats } = output ;
92
- if ( ! output . success || ! i18n . shouldInline ) {
93
- return output ;
94
- }
95
-
96
96
if ( ! webpackStats ) {
97
97
throw new Error ( 'Webpack stats build result is required.' ) ;
98
98
}
99
99
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 } ;
116
121
} ) ,
117
122
) ;
118
123
} ) ,
0 commit comments