File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,19 @@ module.exports = function (defaults) {
8080 staticModifiers : true ,
8181 packagerOptions : {
8282 webpackConfig : {
83+ externals : ( { request, context } , callback ) => {
84+ // Prevent `@mswjs/data` from bundling the `msw` package.
85+ //
86+ // `@crates-io/msw` is importing the ESM build of the `msw` package, but
87+ // `@mswjs/data` is trying to import the CJS build instead. This is causing
88+ // a conflict within webpack. Since we don't need the functionality within
89+ // `@mswjs/data` that requires the `msw` package, we can safely ignore this
90+ // import.
91+ if ( request == 'msw' && context . includes ( '@mswjs/data' ) ) {
92+ return callback ( null , request , 'global' ) ;
93+ }
94+ callback ( ) ;
95+ } ,
8396 resolve : {
8497 fallback : {
8598 // disables `crypto` import warning in `axe-core`
You can’t perform that action at this time.
0 commit comments