File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
packages/storybook-builder/src Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,15 @@ export const CANDIDATES = [
9191 'color-convert' ,
9292] ;
9393
94+ function moduleExists ( moduleName : string ) {
95+ try {
96+ require . resolve ( moduleName , { paths : [ process . cwd ( ) ] } ) ;
97+ return true ;
98+ } catch ( e ) {
99+ return false ;
100+ }
101+ }
102+
94103/**
95104 * Get react-dom version from the resolvedReact preset, which points to either a root react-dom
96105 * dependency or the react-dom dependency shipped with addon-docs
@@ -121,12 +130,3 @@ async function getReactDomShimAlias(options: Options) {
121130 ? require . resolve ( '@storybook/react-dom-shim' )
122131 : require . resolve ( '@storybook/react-dom-shim/dist/react-16' ) ;
123132}
124-
125- function moduleExists ( moduleName : string ) {
126- try {
127- require . resolve ( moduleName , { paths : [ process . cwd ( ) ] } ) ;
128- return true ;
129- } catch ( e ) {
130- return false ;
131- }
132- }
You can’t perform that action at this time.
0 commit comments