File tree Expand file tree Collapse file tree 2 files changed +1
-29
lines changed
Expand file tree Collapse file tree 2 files changed +1
-29
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { type StorybookConfig } from '@storybook/react-vite';
22import preserveDirectives from 'rollup-preserve-directives' ;
33import { mergeConfig , type InlineConfig } from 'vite' ;
44import tsConfigPaths from 'vite-tsconfig-paths' ;
5- import { isLogIgnored } from '../rollup.config.js' ;
65
76const config : StorybookConfig = {
87 stories : [ '../stories/**/*.stories.@(ts|tsx)' , '../stories/**/*.mdx' ] ,
@@ -20,13 +19,6 @@ const config: StorybookConfig = {
2019 return mergeConfig ( config , {
2120 build : {
2221 rollupOptions : {
23- onwarn ( warning , handler ) {
24- if ( isLogIgnored ( warning ) ) {
25- return ;
26- }
27-
28- handler ( warning ) ;
29- } ,
3022 plugins : [ preserveDirectives ( ) ] ,
3123 } ,
3224 } ,
Original file line number Diff line number Diff line change @@ -65,32 +65,12 @@ export default defineConfig(
6565
6666 // Handle warnings as errors
6767 onwarn ( warning ) {
68- if ( isLogIgnored ( warning ) ) {
69- return ;
70- }
71-
7268 throw new Error ( warning . message , { cause : warning } ) ;
7369 } ,
7470 } ) ,
7571 ) ,
7672) ;
7773
7874/**
79- * Whether to ignore Rollup log messages
80- *
81- * @param {RollupLog } warning
82- */
83- export function isLogIgnored ( warning ) {
84- const { code, message } = warning ;
85-
86- // Skip warnings related to "use client" directives including
87- // source map issues when directives are bundled by Storybook
88- return (
89- code === 'SOURCEMAP_ERROR' ||
90- ( code === 'MODULE_LEVEL_DIRECTIVE' && message . includes ( '"use client"' ) )
91- ) ;
92- }
93-
94- /**
95- * @import { OutputOptions, RollupLog, RollupOptions } from 'rollup'
75+ * @import { OutputOptions, RollupOptions } from 'rollup'
9676 */
You can’t perform that action at this time.
0 commit comments