File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export default class Plugin {
60
60
61
61
constructor ( private readonly config : Config = { } ) { }
62
62
63
- private filter ( fileName : string ) : boolean {
63
+ private isCurrentFileNeedsToBeInlined ( fileName : string ) : boolean {
64
64
if ( typeof this . config . filter === 'function' ) {
65
65
return this . config . filter ( fileName )
66
66
} else {
@@ -74,17 +74,13 @@ export default class Plugin {
74
74
const { leaveCSSFile } = this . config
75
75
76
76
Object . keys ( assets ) . forEach ( ( fileName ) => {
77
- if ( isCSS ( fileName ) ) {
78
- const isCurrentFileNeedsToBeInlined = this . filter ( fileName )
79
- if ( isCurrentFileNeedsToBeInlined ) {
77
+ if ( this . isCurrentFileNeedsToBeInlined ( fileName ) ) {
78
+ if ( isCSS ( fileName ) ) {
80
79
this . css [ fileName ] = assets [ fileName ] . source ( )
81
80
if ( ! leaveCSSFile ) {
82
81
delete assets [ fileName ]
83
82
}
84
- }
85
- } else if ( isHTML ( fileName ) ) {
86
- const isCurrentFileNeedsToBeInlined = this . filter ( fileName )
87
- if ( isCurrentFileNeedsToBeInlined ) {
83
+ } else if ( isHTML ( fileName ) ) {
88
84
this . html [ fileName ] = assets [ fileName ] . source ( )
89
85
}
90
86
}
You can’t perform that action at this time.
0 commit comments