@@ -2,13 +2,24 @@ const path = require('path');
22const  spawn  =  require ( 'child_process' ) . spawn ; 
33const  CreateFileWebpack  =  require ( 'create-file-webpack' ) ; 
44const  postcssPlugins  =  require ( '../config/postcss-plugins' ) ; 
5+ // Enabling docs means the preview panel takes an extra 2ish seconds to load 
6+ // This usually isn't a big deal, except when we're running all of our stories 
7+ // through our a11y tests, and a 2s delay over several hundred stories adds up. 
8+ // This is an escape hatch to disable docs only wheile we're running a11y tests 
9+ const  enableDocs  =  ! parseInt ( process . env . STORYBOOK_DISABLE_DOCS  ||  '0' ,  10 ) ; 
510
611module . exports  =  { 
712  core : { 
813    builder : 'webpack5' , 
914  } , 
15+   // Added to work around https://github.com/storybookjs/storybook/issues/15336 
16+   // The line below can be removed in @storybook /react v6.5.0 
17+   typescript : { reactDocgen : false } , 
1018  stories : [ '../playground/stories.tsx' ,  '../src/components/**/*/README.md' ] , 
11-   addons : [ '@storybook/addon-a11y' ,  '@storybook/addon-toolbars' ] , 
19+   addons : [ 
20+     { name : '@storybook/addon-essentials' ,  options : { docs : enableDocs } } , 
21+     '@storybook/addon-a11y' , 
22+   ] , 
1223  webpackFinal : ( config )  =>  { 
1324    const  isProduction  =  config . mode  ===  'production' ; 
1425
@@ -63,6 +74,15 @@ module.exports = {
6374      } , 
6475    ] ; 
6576
77+     config . plugins . push ( 
78+       new  CreateFileWebpack ( { 
79+         path : './build-internal/storybook/static/services/' , 
80+         fileName : 'ping.html' , 
81+         content :
82+           '<!DOCTYPE html><html lang="en"><head></head><body>OK</body></html>' , 
83+       } ) , 
84+     ) ; 
85+ 
6686    config . module . rules  =  [ 
6787      // Strip out existing rules that apply to md files 
6888      ...config . module . rules . filter ( 
0 commit comments