File tree Expand file tree Collapse file tree 4 files changed +34
-3
lines changed Expand file tree Collapse file tree 4 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -523,9 +523,7 @@ async fn runtime_requirement_in_tree(
523523 if runtime_requirements. contains ( RuntimeGlobals :: HMR_DOWNLOAD_UPDATE_HANDLERS )
524524 || runtime_requirements. contains ( RuntimeGlobals :: ENSURE_CHUNK_HANDLERS )
525525 {
526- if let Some ( chunk_filename) = self . options . chunk_filename . template ( )
527- && chunk_filename. contains ( "hash" )
528- {
526+ if self . options . chunk_filename . has_hash_placeholder ( ) {
529527 runtime_requirements_mut. insert ( RuntimeGlobals :: GET_FULL_HASH ) ;
530528 }
531529
Original file line number Diff line number Diff line change 1+ .text {
2+ color : blue;
3+ }
Original file line number Diff line number Diff line change 1+ it ( "should not contain full hash runtime module" , async ( ) => {
2+ await import ( "./index.css" ) ;
3+
4+ const chunk = __non_webpack_require__ ( "fs" ) . readFileSync ( __filename , "utf-8" ) ;
5+ const hashRuntime = [ "__webpack_require__" , "h" ] . join ( "." ) // use join() here to avoid compile time evaluation
6+ expect ( chunk ) . not . toContain ( hashRuntime ) ;
7+ } ) ;
Original file line number Diff line number Diff line change 1+ const { CssExtractRspackPlugin } = require ( "@rspack/core" ) ;
2+
3+ /** @type {import("@rspack/core").Configuration } */
4+ module . exports = {
5+ target : "web" ,
6+ node : {
7+ __filename : false
8+ } ,
9+ module : {
10+ rules : [
11+ {
12+ test : / \. c s s $ / ,
13+ use : [ CssExtractRspackPlugin . loader , "css-loader" ] ,
14+ type : "javascript/auto"
15+ }
16+ ]
17+ } ,
18+ plugins : [
19+ new CssExtractRspackPlugin ( {
20+ filename : "[name][contenthash].css"
21+ } )
22+ ]
23+ } ;
You can’t perform that action at this time.
0 commit comments