File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ const isCSS = (name) => /\.css$/.test(name)
16
16
// const strip = (str) => str.replace(/\/$/, '')
17
17
18
18
class CssUrlRelativePlugin {
19
-
20
19
constructor ( options ) {
21
20
this . options = options || { }
22
21
this . plugin = {
@@ -65,13 +64,13 @@ class CssUrlRelativePlugin {
65
64
done ( )
66
65
}
67
66
68
- applyCompilation = ( compilation ) => {
67
+ applyCompilation ( compilation ) {
69
68
// webpack version <= 4
70
69
if ( webpackMajorVersion <= 4 ) {
71
- compilation . hooks . optimizeChunkAssets . tapAsync ( plugin , ( chunks , done ) => {
70
+ compilation . hooks . optimizeChunkAssets . tapAsync ( this . plugin , ( chunks , done ) => {
72
71
this . fixCssUrl ( compilation , chunks , done )
73
72
} )
74
- return ;
73
+ return
75
74
}
76
75
77
76
// webpack verion = 5
@@ -88,7 +87,7 @@ class CssUrlRelativePlugin {
88
87
89
88
apply ( compiler ) {
90
89
// use compilation instead of this-compilation, just like other plugins do
91
- compiler . hooks . compilation . tap ( this . plugin , this . applyCompilation )
90
+ compiler . hooks . compilation . tap ( this . plugin , this . applyCompilation . bind ( this ) )
92
91
}
93
92
}
94
93
Original file line number Diff line number Diff line change 50
50
"mocha" : " ^3.0.2" ,
51
51
"npm-ensure" : " ^1.0.0" ,
52
52
"nyc" : " 11.x" ,
53
- "standard" : " ^8.2.0 " ,
53
+ "standard" : " 11.x " ,
54
54
"webpack" : " ^4.10.2"
55
55
},
56
56
"repository" : {
You can’t perform that action at this time.
0 commit comments