@@ -59,23 +59,24 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
5959
6060 return [
6161 postcssUrl ( {
62- url : ( URL : string ) => {
62+ url : ( URL : { url : string } ) => {
63+ const { url } = URL ;
6364 // Only convert root relative URLs, which CSS-Loader won't process into require().
64- if ( ! URL . startsWith ( '/' ) || URL . startsWith ( '//' ) ) {
65- return URL ;
65+ if ( ! url . startsWith ( '/' ) || url . startsWith ( '//' ) ) {
66+ return URL . url ;
6667 }
6768
6869 if ( deployUrl . match ( / : \/ \/ / ) ) {
6970 // If deployUrl contains a scheme, ignore baseHref use deployUrl as is.
70- return `${ deployUrl . replace ( / \/ $ / , '' ) } ${ URL } ` ;
71+ return `${ deployUrl . replace ( / \/ $ / , '' ) } ${ url } ` ;
7172 } else if ( baseHref . match ( / : \/ \/ / ) ) {
7273 // If baseHref contains a scheme, include it as is.
7374 return baseHref . replace ( / \/ $ / , '' ) +
74- `/${ deployUrl } /${ URL } ` . replace ( / \/ \/ + / g, '/' ) ;
75+ `/${ deployUrl } /${ url } ` . replace ( / \/ \/ + / g, '/' ) ;
7576 } else {
7677 // Join together base-href, deploy-url and the original URL.
7778 // Also dedupe multiple slashes into single ones.
78- return `/${ baseHref } /${ deployUrl } /${ URL } ` . replace ( / \/ \/ + / g, '/' ) ;
79+ return `/${ baseHref } /${ deployUrl } /${ url } ` . replace ( / \/ \/ + / g, '/' ) ;
7980 }
8081 }
8182 } ) ,
0 commit comments