@@ -47,6 +47,8 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
47
47
// https://github.com/webpack-contrib/style-loader#recommended-configuration
48
48
const cssSourceMap = buildOptions . extractCss && buildOptions . sourcemaps ;
49
49
50
+ // Maximum resource size to inline (KiB)
51
+ const maximumInlineSize = 10 ;
50
52
// Minify/optimize css in production.
51
53
const minimizeCss = buildOptions . target === 'production' ;
52
54
// Convert absolute resource URLs to account for base-href and deploy-url.
@@ -122,12 +124,15 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
122
124
} ,
123
125
{
124
126
// TODO: inline .cur if not supporting IE (use browserslist to check)
125
- filter : ( asset : PostcssUrlAsset ) => ! asset . hash && ! asset . absolutePath . endsWith ( '.cur' ) ,
127
+ filter : ( asset : PostcssUrlAsset ) => {
128
+ return maximumInlineSize > 0 && ! asset . hash && ! asset . absolutePath . endsWith ( '.cur' ) ;
129
+ } ,
126
130
url : 'inline' ,
127
131
// NOTE: maxSize is in KB
128
- maxSize : 10 ,
132
+ maxSize : maximumInlineSize ,
129
133
fallback : 'rebase' ,
130
- }
134
+ } ,
135
+ { url : 'rebase' } ,
131
136
] ) ,
132
137
autoprefixer ( ) ,
133
138
] . concat (
@@ -141,7 +146,7 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
141
146
'cssnano' : 'cssnano' ,
142
147
'postcss-import' : 'postcssImports' ,
143
148
} ,
144
- variables : { minimizeCss, baseHref, deployUrl, projectRoot }
149
+ variables : { minimizeCss, baseHref, deployUrl, projectRoot, maximumInlineSize }
145
150
} ;
146
151
147
152
// determine hashing format
0 commit comments