1- // This file has been automatically migrated to valid ESM format by Storybook.
2- import { fileURLToPath } from "node:url" ;
3- import { resolve , dirname } from "path" ;
1+ import { resolve } from "path" ;
42
53import type { StorybookConfig } from "@storybook/react-vite" ;
64import { mergeConfig } from "vite" ;
75
8- const __filename = fileURLToPath ( import . meta. url ) ;
9- const __dirname = dirname ( __filename ) ;
10-
116const config : StorybookConfig = {
127 stories : [ "../src/**/*.stories.@(js|ts|tsx|mdx)" ] ,
13- addons : [
14- "@storybook/addon-onboarding" ,
15- "@storybook/addon-a11y" ,
16- "@storybook/addon-themes" ,
17- "@chromatic-com/storybook" ,
18- "@storybook/addon-docs" ,
19- ] ,
20-
8+ addons : [ "@storybook/addon-essentials" , "@storybook/addon-styling" ] ,
219 framework : {
2210 name : "@storybook/react-vite" ,
2311 options : { } ,
2412 } ,
25-
2613 core : {
2714 disableTelemetry : true ,
2815 } ,
29-
3016 staticDirs : [ "./public" ] ,
31-
3217 viteFinal ( config , { configType } ) {
3318 return mergeConfig ( config , {
3419 define : {
@@ -61,29 +46,7 @@ const config: StorybookConfig = {
6146 find : "@reearth/core" ,
6247 replacement : resolve ( __dirname , ".." , "node_modules/@reearth/core" ) ,
6348 } ,
64- // cesium-mvt-imagery-provider: force resolution to the JS bundle, not the .d.ts types file
65- {
66- find : "cesium-mvt-imagery-provider" ,
67- replacement : resolve (
68- __dirname ,
69- ".." ,
70- "node_modules/cesium-mvt-imagery-provider/dist/cesium-mvt-imagery-provider.mjs" ,
71- ) ,
72- } ,
73- // quickjs-emscripten: force resolution to the JS bundle, not the .d.ts types file
74- {
75- find : "quickjs-emscripten-sync" ,
76- replacement : resolve (
77- __dirname ,
78- ".." ,
79- "node_modules/quickjs-emscripten-sync/dist/quickjs-emscripten-sync.mjs" ,
80- ) ,
81- } ,
82- // react-align: force resolution to the JS bundle, not the .d.ts types file
83- {
84- find : "react-align" ,
85- replacement : resolve ( __dirname , ".." , "node_modules/react-align/dist/react-align.mjs" ) ,
86- } ,
49+ // quickjs-emscripten
8750 {
8851 find : "@reearth" ,
8952 replacement : resolve ( __dirname , ".." , "src" ) ,
@@ -94,10 +57,6 @@ const config: StorybookConfig = {
9457 } ,
9558 ] ,
9659 } ,
97- optimizeDeps : {
98- include : [ "quickjs-emscripten-sync" , "prop-types" , "hoist-non-react-statics" , "react-is" ] ,
99- exclude : [ "react-align" ] ,
100- } ,
10160 server : {
10261 watch : {
10362 // https://github.com/storybookjs/storybook/issues/22253#issuecomment-1673229400
@@ -106,11 +65,8 @@ const config: StorybookConfig = {
10665 } ,
10766 } ) ;
10867 } ,
109-
110- docs : { } ,
111-
112- typescript : {
113- reactDocgen : "react-docgen-typescript" ,
68+ docs : {
69+ autodocs : true ,
11470 } ,
11571} ;
116- export default config ;
72+ module . exports = config ;
0 commit comments