File tree Expand file tree Collapse file tree 3 files changed +27
-8
lines changed Expand file tree Collapse file tree 3 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,24 @@ module.exports = {
144144};
145145```
146146
147+ ### Stats
148+
149+ By default, the plugin will print a quite verbose bundle information to your console. However, if
150+ you are not satisfy with the current output info, you can overwrite it in your ` webpack.config.js `
151+
152+ ``` js
153+ // webpack.config.js
154+
155+ module .export = {
156+ // ...
157+ stats: ' minimal'
158+ // ...
159+ }
160+ ```
161+
162+ All the stats config can be found in [ webpack's documentation] ( https://webpack.js.org/configuration/stats/ )
163+
164+
147165### Node modules / externals
148166
149167By default, the plugin will try to bundle all dependencies. However, you don't
Original file line number Diff line number Diff line change @@ -19,15 +19,16 @@ module.exports = {
1919 }
2020
2121 const compileOutputPaths = [ ] ;
22+ const consoleStats = this . webpackConfig . stats || {
23+ colors : true ,
24+ hash : false ,
25+ version : false ,
26+ chunks : false ,
27+ children : false
28+ } ;
2229
2330 _ . forEach ( stats . stats , compileStats => {
24- this . serverless . cli . consoleLog ( compileStats . toString ( {
25- colors : true ,
26- hash : false ,
27- version : false ,
28- chunks : false ,
29- children : false
30- } ) ) ;
31+ this . serverless . cli . consoleLog ( compileStats . toString ( consoleStats ) ) ;
3132
3233 if ( compileStats . compilation . errors . length ) {
3334 throw new Error ( 'Webpack compilation error, see above' ) ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ module.exports = {
2222 }
2323
2424 if ( stats ) {
25- console . log ( stats . toString ( ) ) ; // eslint-disable-line no-console
25+ this . serverless . cli . consoleLog ( stats . toString ( this . webpackConfig . stats ) ) ;
2626 }
2727 } ) ;
2828
You can’t perform that action at this time.
0 commit comments