@@ -44,6 +44,8 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
44
44
const extraPlugins : any [ ] = [ ] ;
45
45
const cssSourceMap = buildOptions . sourcemaps ;
46
46
47
+ // Maximum resource size to inline (KiB)
48
+ const maximumInlineSize = 10 ;
47
49
// Minify/optimize css in production.
48
50
const minimizeCss = buildOptions . target === 'production' ;
49
51
// Convert absolute resource URLs to account for base-href and deploy-url.
@@ -110,12 +112,15 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
110
112
} ,
111
113
{
112
114
// TODO: inline .cur if not supporting IE (use browserslist to check)
113
- filter : ( asset : PostcssUrlAsset ) => ! asset . hash && ! asset . absolutePath . endsWith ( '.cur' ) ,
115
+ filter : ( asset : PostcssUrlAsset ) => {
116
+ return maximumInlineSize > 0 && ! asset . hash && ! asset . absolutePath . endsWith ( '.cur' ) ;
117
+ } ,
114
118
url : 'inline' ,
115
119
// NOTE: maxSize is in KB
116
- maxSize : 10 ,
120
+ maxSize : maximumInlineSize ,
117
121
fallback : 'rebase' ,
118
- }
122
+ } ,
123
+ { url : 'rebase' } ,
119
124
] ) ,
120
125
autoprefixer ( ) ,
121
126
] ;
@@ -126,7 +131,7 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
126
131
'postcss-url' : 'postcssUrl' ,
127
132
'postcss-import' : 'postcssImports' ,
128
133
} ,
129
- variables : { minimizeCss, baseHref, deployUrl, projectRoot }
134
+ variables : { minimizeCss, baseHref, deployUrl, projectRoot, maximumInlineSize }
130
135
} ;
131
136
132
137
// determine hashing format
0 commit comments