friendly-errors-webpack-plugin icon indicating copy to clipboard operation
friendly-errors-webpack-plugin copied to clipboard

Config setup with multi-compiler Webpack CLI?

Open coreyleelarson opened this issue 7 years ago • 2 comments

How should the plugin be applied in a multi-compiler setup when used with the webpack CLI? https://github.com/geowarin/friendly-errors-webpack-plugin/pull/9 does not give a clear indication on how the configs should look, and there has been no response in the closed issues on this (https://github.com/geowarin/friendly-errors-webpack-plugin/issues/16 and https://github.com/geowarin/friendly-errors-webpack-plugin/issues/8).

I even looked at the tests to try and figure it out, but they appear to use the Node API only, not the Webpack CLI.

Below is a skeleton example of what I'm working with. If I apply the friendly errors plugin to both configs I get two compilations showing different compilation times. It is especially frustrating with clearConsole: true because if the first finisher has an error and second finisher is successful, the terminal is cleared and only shows the success message.

If someone could provide some insight into this, it'd be greatly appreciated. This plugins looks like it would help out my development workflow tremendously, but it doesn't seem to work as expected with this setup.

webpack.config1.babel.js

import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';

export default {
  entry: {
    ...
  },
  output: {
    ...
  },
  plugins: [
    new FriendlyErrorsPlugin()
  ]
}

webpack.config2.babel.js

import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';

export default {
  entry: {
    ...
  },
  output: {
    ...
  },
  plugins: [
    new FriendlyErrorsPlugin()
  ]
}

webpack.config.babel.js

import configOne from './webpack.config1.babel';
import configTwo from './webpack.config2.babel';

export default [configOne, configTwo];

coreyleelarson avatar Jun 26 '17 15:06 coreyleelarson

+1

dcalsky avatar Sep 12 '17 10:09 dcalsky

+1

matteobad avatar Sep 09 '19 21:09 matteobad