Skip to content

Commit cea10ff

Browse files
Copilothotlong
andcommitted
fix: add missing package aliases and suppress sourcemap warnings in Storybook config
- Add @object-ui/types, @object-ui/i18n, @object-ui/mobile source aliases - Add Rollup onwarn handler to suppress "use client" directive and sourcemap warnings Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 6a3a5e9 commit cea10ff

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.storybook/main.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ const config: StorybookConfig = {
3535
// Alias components package to source to avoid circular dependency during build
3636
'@object-ui/core': path.resolve(__dirname, '../packages/core/src/index.ts'),
3737
'@object-ui/react': path.resolve(__dirname, '../packages/react/src/index.ts'),
38+
'@object-ui/types': path.resolve(__dirname, '../packages/types/src/index.ts'),
39+
'@object-ui/i18n': path.resolve(__dirname, '../packages/i18n/src/index.ts'),
40+
'@object-ui/mobile': path.resolve(__dirname, '../packages/mobile/src/index.ts'),
3841
'@object-ui/components': path.resolve(__dirname, '../packages/components/src/index.ts'),
3942
'@object-ui/fields': path.resolve(__dirname, '../packages/fields/src/index.tsx'),
4043
'@object-ui/layout': path.resolve(__dirname, '../packages/layout/src/index.ts'),
@@ -79,6 +82,15 @@ const config: StorybookConfig = {
7982
},
8083
build: {
8184
target: 'esnext',
85+
rollupOptions: {
86+
onwarn(warning, warn) {
87+
// Suppress "use client" directive warnings and sourcemap resolution errors
88+
if (warning.code === 'MODULE_LEVEL_DIRECTIVE' || warning.message?.includes('sourcemap')) {
89+
return;
90+
}
91+
warn(warning);
92+
},
93+
},
8294
},
8395
});
8496
},

0 commit comments

Comments
 (0)