File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed
examples/react-component-bundle-false/src/components/CounterButton Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 11.button {
2- background : yellow ;
2+ background : url ( ' ../../assets/logo.svg ' ) no-repeat ;
33}
Original file line number Diff line number Diff line change @@ -993,6 +993,7 @@ const composeBundlelessExternalConfig = (
993993 if ( ! request || ! getResolve || ! context || ! contextInfo ) {
994994 return callback ( ) ;
995995 }
996+ console . log ( 222222 , data ) ;
996997
997998 if ( ! resolver ) {
998999 resolver = ( await getResolve ( ) ) as RspackResolver ;
@@ -1009,6 +1010,7 @@ const composeBundlelessExternalConfig = (
10091010 jsExtension ,
10101011 cssModulesAuto ,
10111012 isStyleRedirected ,
1013+ contextInfo . issuer ,
10121014 ) ;
10131015
10141016 if ( cssExternal !== false ) {
@@ -1060,6 +1062,7 @@ const composeBundlelessExternalConfig = (
10601062 / \. [ ^ . ] + $ / ,
10611063 jsExtension ,
10621064 ) ;
1065+ // return callback();
10631066 }
10641067 } else {
10651068 resolvedRequest = `${ resolvedRequest } ${ jsExtension } ` ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { RSLIB_CSS_ENTRY_FLAG } from './cssConfig';
33import {
44 ABSOLUTE_PUBLIC_PATH ,
55 AUTO_PUBLIC_PATH ,
6- // BASE_URI,
6+ BASE_URI ,
77 SINGLE_DOT_PATH_SEGMENT ,
88} from './libCssExtractLoader' ;
99import { getUndoPath } from './utils' ;
@@ -71,7 +71,7 @@ class LibCssExtractPlugin implements Rspack.RspackPluginInstance {
7171 ) ;
7272 replace ( `${ ABSOLUTE_PUBLIC_PATH } ${ AUTO_PUBLIC_PATH } ` , undoPath ) ;
7373 replace ( ABSOLUTE_PUBLIC_PATH , '' ) ;
74- // replace(`${BASE_URI}/`, undoPath);
74+ replace ( `${ BASE_URI } /` , undoPath ) ;
7575
7676 return replaceSource ;
7777 } ) ;
Original file line number Diff line number Diff line change @@ -85,14 +85,19 @@ export function cssExternalHandler(
8585 jsExtension : string ,
8686 auto : CssLoaderOptionsAuto ,
8787 isStyleRedirect : boolean ,
88+ issuer : string ,
8889) : void | false {
8990 const isCssModulesRequest = isCssModulesFile ( request , auto ) ;
9091
9192 // cssExtract would execute the file handled by css-loader, so we cannot external the "helper import" from css-loader
92- // do not external @rsbuild /core/compiled/css-loader/noSourceMaps.js, sourceMaps.js, api.mjs etc.
93+ // 1. do not external @rsbuild/core/compiled/css-loader/noSourceMaps.js, sourceMaps.js, api.mjs etc.
9394 if ( / c o m p i l e d \/ c s s - l o a d e r \/ / . test ( request ) ) {
9495 return callback ( ) ;
9596 }
97+ // 2.
98+ if ( isCssFile ( issuer ) && ! isCssFile ( request ) ) {
99+ return callback ( ) ;
100+ }
96101
97102 // 1. css modules: import './CounterButton.module.scss' -> import './CounterButton.module.mjs'
98103 // 2. css global: import './CounterButton.scss' -> import './CounterButton.css'
You can’t perform that action at this time.
0 commit comments