serverless-heaven / serverless-webpack

Serverless plugin to bundle your lambdas with Webpack
MIT License
1.72k stars 417 forks source link

Webpack progress mode with serverless-offline? #538

Open leny opened 5 years ago

leny commented 5 years ago

Hi, thanks for your work on the plugin,

This is a question / bug report?

Description

I use serverless-webpack with serverless-offline.
All works well, launched with this command: $ npx serverless offline --port 9080.

But when I perform a change in my code, webpack build the code but didn't give any information on progress, which can take time when I'm working with many lambda functions.

I would like to have the same behavior as when I use webpack outside of serverless, with the cli option --progress.

I've searched in the docs but can't find any information on this.

Nothing fancy.

Additional Data

Thanks in advance,

bitttttten commented 5 years ago

Can you try adding the ProgressPlugin into your serverless webpack configs file if it detects --progress passed as a CLI param? Or just remove the argument check and always include the webpack.ProgressPlugin plugin.

// serverless.webpack.config.js
const webpack = require("webpack");

module.exports = {
  /* .. */
  plugins: [
    process.argv.includes('--progress') && new webpack.ProgressPlugin((percentage, message, ...args) => {
      // e.g. Output each progress message directly to the console:
      console.info(percentage, message, ...args);
    })
  ].filter(Boolean),
  /* .. */
};