File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { dirname, join } from 'path';
22import type { StorybookConfig } from '@storybook/react-vite' ;
33import remarkGfm from 'remark-gfm' ;
44import type { StoriesEntry } from 'storybook/internal/types' ;
5+ import { mergeConfig } from 'vite' ;
56import { isChromatic } from './utils.ts' ;
67
78const isDevMode = process . env . NODE_ENV === 'development' ;
@@ -78,6 +79,12 @@ const config: StorybookConfig = {
7879 reactDocgen : 'react-docgen-typescript' ,
7980 } ,
8081 staticDirs : isDevMode ? [ 'images-dev' ] : [ 'images' ] ,
82+ viteFinal : ( viteConfig ) =>
83+ mergeConfig ( viteConfig , {
84+ build : {
85+ target : 'esnext' ,
86+ } ,
87+ } ) ,
8188} ;
8289
8390export default config ;
Original file line number Diff line number Diff line change @@ -22,6 +22,14 @@ export default defineConfig(() => {
2222 '@/' : fileURLToPath ( new URL ( './' , import . meta. url ) ) ,
2323 } ,
2424 } ,
25+ optimizeDeps : {
26+ esbuildOptions : {
27+ target : 'esnext' ,
28+ } ,
29+ } ,
30+ build : {
31+ target : 'esnext' ,
32+ } ,
2533 plugins : [
2634 react ( ) ,
2735 process . env . CYPRESS === 'true' &&
You can’t perform that action at this time.
0 commit comments