File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
- import { Compiler } from 'webpack' ;
1
+ import { Compiler , Configuration } from 'webpack' ;
2
2
3
3
type File = {
4
4
[ key : string ] : string
@@ -43,13 +43,14 @@ export default class Plugin
43
43
} ) ;
44
44
}
45
45
46
- private process ( { assets } : Compilation ) {
46
+ private process ( { assets } : Compilation , { output } : Configuration ) {
47
+ const publicPath = ( output && output . publicPath ) || '' ;
47
48
Object . keys ( this . html ) . forEach ( ( htmlFileName ) => {
48
49
let html = this . html [ htmlFileName ] ;
49
50
50
51
Object . keys ( this . css ) . forEach ( ( key ) => {
51
52
html = Plugin . addStyle ( html , this . css [ key ] ) ;
52
- html = Plugin . removeLinkTag ( html , key ) ;
53
+ html = Plugin . removeLinkTag ( html , publicPath + key ) ;
53
54
} ) ;
54
55
55
56
assets [ htmlFileName ] = {
@@ -62,7 +63,7 @@ export default class Plugin
62
63
apply ( compiler : Compiler ) {
63
64
compiler . hooks . emit . tapAsync ( 'html-inline-css-webpack-plugin' , ( compilation : Compilation , callback : ( ) => void ) => {
64
65
this . prepare ( compilation ) ;
65
- this . process ( compilation ) ;
66
+ this . process ( compilation , compiler . options ) ;
66
67
callback ( ) ;
67
68
} ) ;
68
69
}
You can’t perform that action at this time.
0 commit comments