2020const { readFileSync } = require ( 'fs' ) ;
2121const webpack = require ( 'webpack' ) ;
2222const CircularDependencyPlugin = require ( 'circular-dependency-plugin' ) ;
23- const { loadCsf } = require ( '@storybook/csf-tools' ) ;
23+ // eslint-disable-next-line node/no-missing-require
24+ const { loadCsf } = require ( 'storybook/internal/csf-tools' ) ;
2425
2526/** @type { import('@storybook/react-webpack5').StorybookConfig } */
2627module . exports = {
@@ -33,6 +34,7 @@ module.exports = {
3334 '../packages/design-system/src/**/stories/index.js' ,
3435 '../packages/animation/src/**/stories/*.js' ,
3536 ] ,
37+
3638 experimental_indexers : ( indexers ) => {
3739 const createIndex = ( fileName , opts ) => {
3840 const code = readFileSync ( fileName , {
@@ -51,32 +53,25 @@ module.exports = {
5153 ...( indexers || [ ] ) ,
5254 ] ;
5355 } ,
56+
5457 addons : [
5558 '@storybook/addon-a11y/register' ,
56- {
57- name : '@storybook/addon-essentials' ,
58- options : {
59- actions : true ,
60- backgrounds : true ,
61- controls : false ,
62- // See https://github.com/hipstersmoothie/react-docgen-typescript-plugin/issues/83
63- docs : false ,
64- viewport : true ,
65- toolbars : true ,
66- } ,
67- } ,
6859 '@storybook/addon-webpack5-compiler-babel' ,
6960 ] ,
61+
7062 framework : {
7163 name : '@storybook/react-webpack5' ,
7264 options : { } ,
7365 } ,
66+
7467 core : {
7568 disableTelemetry : true ,
7669 } ,
70+
7771 docs : {
7872 disabled : true ,
7973 } ,
74+
8075 //eslint-disable-next-line require-await -- Negligible.
8176 webpackFinal : async ( webpackConfig ) => {
8277 // webpack < 5 used to include polyfills for node.js core modules by default.
@@ -94,6 +89,8 @@ module.exports = {
9489 module : false ,
9590 assert : false ,
9691 perf_hooks : false ,
92+ crypto : false ,
93+ worker_threads : false ,
9794 } ,
9895 } ;
9996
@@ -256,4 +253,12 @@ module.exports = {
256253 ) ;
257254 return webpackConfig ;
258255 } ,
256+
257+ features : {
258+ actions : true ,
259+ backgrounds : true ,
260+ controls : false ,
261+ viewport : true ,
262+ toolbars : true ,
263+ } ,
259264} ;
0 commit comments