File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -161,9 +161,10 @@ module.exports = (webpackEnv, argv) => {
161161      // Add /* filename */ comments to generated require()s in the output. 
162162      // TODO: rspack: pathinfo: isEnvDevelopment, 
163163      // There will be one main bundle, and one file per asynchronous chunk. 
164-       filename : '[name].[contenthash:8].js' , 
164+       // Fix HMR error in development: https://github.com/webpack/webpack-dev-server/issues/3168#issuecomment-816709164 
165+       filename : isEnvDevelopment  ? '[name].js'  : '[name].[contenthash:8].js' , 
165166      // There are also additional JS chunk files if you use code splitting. 
166-       chunkFilename : '[name].[contenthash:8].chunk.js' , 
167+       chunkFilename : isEnvDevelopment  ?  '[name].chunk.js'  :  '[name].[contenthash:8].chunk.js' , 
167168      assetModuleFilename : 'assets/[name].[hash][ext]' , 
168169      // webpack uses `publicPath` to determine where the app is being served from. 
169170      // It requires a trailing slash, or the file assets will get an incorrect path. 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments