@@ -6,7 +6,9 @@ import {rspack} from '@rspack/core';
66const resolveModule = ( a ) => fileURLToPath ( import . meta. resolve ( a ) ) ;
77
88const {
9+ ContextReplacementPlugin,
910 EnvironmentPlugin,
11+ IgnorePlugin,
1012 NormalModuleReplacementPlugin,
1113 ProvidePlugin,
1214} = rspack ;
@@ -37,6 +39,9 @@ const rules = [{
3739 loader : 'babel-loader' ,
3840} , {
3941 test : / \. [ m c ] ? j s $ / ,
42+ resolve : {
43+ fullySpecified : false ,
44+ } ,
4045 exclude : [ / n o d e _ m o d u l e s / , / s w \/ s w \. j s $ / ] ,
4146 loader : 'builtin:swc-loader' ,
4247 options : {
@@ -59,6 +64,11 @@ const plugins = [
5964 new NormalModuleReplacementPlugin ( / ^ n o d e : / , ( resource ) => {
6065 resource . request = resource . request . replace ( / ^ n o d e : / , '' ) ;
6166 } ) ,
67+ new ContextReplacementPlugin ( / @ p u t o u t \/ e n g i n e - l o a d e r / , / N E V E R _ M A T C H ^ / ) ,
68+ new IgnorePlugin ( { resourceRegExp : / h e r m e s - p a r s e r / } ) ,
69+ new NormalModuleReplacementPlugin ( / e s p r i m a / , `${ rootDir } .rspack/empty.js` ) ,
70+ new NormalModuleReplacementPlugin ( / a c o r n - s t a g e 3 / , `${ rootDir } .rspack/empty.js` ) ,
71+ new NormalModuleReplacementPlugin ( / t e n k o / , `${ rootDir } .rspack/empty.js` ) ,
6272 new EnvironmentPlugin ( {
6373 NODE_ENV ,
6474 } ) ,
@@ -118,7 +128,9 @@ export default {
118128 fallback : {
119129 path : resolveModule ( 'path-browserify' ) ,
120130 process : resolveModule ( 'process/browser' ) ,
131+ 'process/browser' : resolveModule ( 'process/browser' ) ,
121132 util : resolveModule ( 'util' ) ,
133+ module : false ,
122134 } ,
123135 } ,
124136 devtool,
@@ -173,9 +185,9 @@ export default {
173185 } ,
174186 plugins,
175187 performance : {
176- maxEntrypointSize : 1_600_000 ,
188+ maxEntrypointSize : 2_200_000 ,
177189 // The lazy menu includes Putout; splitting it for caching is a future optimization.
178- maxAssetSize : 1_500_000 ,
190+ maxAssetSize : 1_600_000 ,
179191 } ,
180192} ;
181193
0 commit comments