Skip to content

Commit d91645c

Browse files
Copilothotlong
andcommitted
fix: suppress unresolved driver-memory import warning in msw-react-crud vite build
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 4ee54b0 commit d91645c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

examples/msw-react-crud/vite.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ export default defineConfig({
2020
commonjsOptions: {
2121
include: [/node_modules/, /packages/],
2222
transformMixedEsModules: true
23+
},
24+
rollupOptions: {
25+
// Suppress warnings for optional dynamic imports in runtime
26+
onwarn(warning, warn) {
27+
// Ignore unresolved import warnings for @objectstack/driver-memory
28+
// This is an optional dynamic import in the runtime that gets resolved at build time
29+
if (
30+
warning.code === 'UNRESOLVED_IMPORT' &&
31+
warning.message.includes('@objectstack/driver-memory')
32+
) {
33+
return;
34+
}
35+
warn(warning);
36+
}
2337
}
2438
}
2539
});

0 commit comments

Comments
 (0)