Skip to content

Commit 9a3f95a

Browse files
committed
reduce dev console noise about local assets not served by MSW
1 parent a61ecf2 commit 9a3f95a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/msw-mock-api.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,13 @@ export async function startMockAPI() {
8484
// pass through to the server
8585
onUnhandledRequest(req) {
8686
const path = new URL(req.url).pathname
87+
// Files that get pulled in dynamic imports. It is expected that MSW will
88+
// not handle them and they fall through to the dev server, so warning
89+
// about them is just noise.
8790
const ignore = [
88-
path.includes('libs/ui/assets'), // assets obviously loaded from file system
89-
path.startsWith('/forms/'), // lazy loaded forms
91+
path.includes('libs/ui/assets'),
92+
path.startsWith('/app'),
93+
path.startsWith('/node_modules'),
9094
].some(Boolean)
9195
if (!ignore) {
9296
// message format copied from MSW source

0 commit comments

Comments
 (0)