File tree 4 files changed +29
-11
lines changed
4 files changed +29
-11
lines changed Original file line number Diff line number Diff line change 1
- const FriendlyErrorsWebpackPlugin = require ( 'friendly-errors-webpack-plugin ' )
1
+ const FriendlyErrorsPlugin = require ( './plugins/FriendlyErrorPlugin ' )
2
2
3
3
exports . extend = function ( config ) {
4
4
config
5
5
. plugin ( 'friendly-error' )
6
- . use ( FriendlyErrorsWebpackPlugin , [
7
- {
8
- clearConsole : false ,
9
- additionalTransformers : [
10
- require ( './error/transformer-module-not-found' ) ,
11
- ]
12
- }
13
- ] )
6
+ . use ( FriendlyErrorsPlugin )
14
7
}
15
8
16
9
exports . extendDevServer = function ( serverOptions = { } ) {
Original file line number Diff line number Diff line change
1
+ const FriendlyErrorsWebpackPlugin = require ( 'friendly-errors-webpack-plugin' )
2
+ const output = require ( 'friendly-errors-webpack-plugin/src/output' )
3
+
4
+ const ID = `FriendlyErrorsPlugin`
5
+
6
+ class FriendlyErrorsPlugin {
7
+ apply ( compiler ) {
8
+ const friendlyError = new FriendlyErrorsWebpackPlugin ( {
9
+ clearConsole : false ,
10
+ additionalTransformers : [
11
+ require ( '../error/transformer-module-not-found' ) ,
12
+ ]
13
+ } )
14
+
15
+ friendlyError . apply ( compiler )
16
+
17
+ compiler . hooks . failed . tap ( ID , error => {
18
+ friendlyError . clearConsole ( )
19
+ output . title ( 'error' , 'ERROR' , `Failed to compile with 1 errors` )
20
+ console . log ( error . stack || error . message )
21
+ } )
22
+ }
23
+ }
24
+
25
+ module . exports = FriendlyErrorsPlugin
Original file line number Diff line number Diff line change 50
50
"exit" : " ^0.1.2" ,
51
51
"fast-memoize" : " ^2.5.1" ,
52
52
"file-loader" : " ^4.3.0" ,
53
- "friendly-errors-webpack-plugin" : " ^ 1.7.0" ,
53
+ "friendly-errors-webpack-plugin" : " 1.7.0" ,
54
54
"hash-sum" : " ^2.0.0" ,
55
55
"html-webpack-plugin" : " ^4.0.0-beta.4" ,
56
56
"less" : " ^3.10.3" ,
Original file line number Diff line number Diff line change 6797
6797
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
6798
6798
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
6799
6799
6800
- friendly-errors-webpack-plugin@^1.7.0:
6800
+ friendly-errors-webpack-plugin@1.7.0, friendly-errors-webpack-plugin@ ^1.7.0:
6801
6801
version "1.7.0"
6802
6802
resolved "https://registry.yarnpkg.com/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.0.tgz#efc86cbb816224565861a1be7a9d84d0aafea136"
6803
6803
integrity sha512-K27M3VK30wVoOarP651zDmb93R9zF28usW4ocaK3mfQeIEI5BPht/EzZs5E8QLLwbLRJQMwscAjDxYPb1FuNiw==
You can’t perform that action at this time.
0 commit comments