Skip to content

Commit

Permalink
Hide module level directive warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Jul 3, 2024
1 parent 190bb37 commit 3fb6e14
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/snaps-storybook/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ export const previewHead: PresetProperty<'previewHead'> = (head = '') => `
export const viteFinal: ViteFinal = (config) => {
return {
...config,
build: {
...config.build,
rollupOptions: {
...config.build?.rollupOptions,
onwarn: (warning, warn) => {
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
return;
}

warn(warning);
},
},
},
plugins: [
...(config.plugins as PluginOption[]),
nodePolyfills({
Expand Down

0 comments on commit 3fb6e14

Please sign in to comment.