serverless-heaven / serverless-webpack

Serverless plugin to bundle your lambdas with Webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use stats option to overwrite console.log behaviour

dangcuuson opened this issue · comments

This is a Feature Proposal

Description

Currently, the stats options in webpack.config.js seems to be ignored. No matter what I put in my webpack.config.js, the console output is the same, which I find them too verbose and annoying, especially when developing & watch. E.g:

image

I think it would be good if we can allow webpack stats config to overwrite the default behaviour.

[Update]
After digging through the source, I think the we can do it easily by updating lib/compile.js
and lib/wpwatch.js

I can make a PR if you're ok with this.

Similar or dependent issue(s):

  • Can't find any

Additional Data

  • Serverless-Webpack Version you're using: 3.1.2
  • Webpack version you're using: 3.8.1
  • Serverless Framework Version you're using: 1.23.0

Hi @dangcuuson , thanks for the thoughts.

you're absolutely right that the stats output currently is not configurable and the two locations are the right place to have a possible configuration in (there is a 3rd one at run/watch that is used on serverless invoke local --watch but there the output is disabled completely).

I think we can let the default be as it is now (i.e. print the whole data if nothing else is specified), but if overridden in the config, that should be used.

The approach to let the stats config option override our defaults sounds good to me. I'm happy if you do a PR for the issue 😃