friendly-errors-webpack-plugin
friendly-errors-webpack-plugin copied to clipboard
Config setup with multi-compiler Webpack CLI?
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];
+1
+1