mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-03 05:04:51 +08:00
ROLLBACK the change to allow for any string to be loadable, as this is nightmare-scenario for webpack
"Critical dependency: the request of a dependency is an expression" Instead allow the array to contain "functions that do the require & return exports" or "the exports directly"
This commit is contained in:
parent
8899e90c13
commit
cb49e217fb
@ -94,7 +94,8 @@ function configure(
|
||||
});
|
||||
|
||||
if (stories && stories.length) {
|
||||
storybook.configure(stories, false);
|
||||
// eslint-disable-next-line global-require, import/no-dynamic-require
|
||||
storybook.configure(stories.map(f => require(f)), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -358,12 +358,12 @@ export default function start(render, { decorateStory } = {}) {
|
||||
typeof req.resolve === 'function' ? req.resolve(filename) : null
|
||||
);
|
||||
});
|
||||
} else {
|
||||
const fileExports = require(req);
|
||||
currentExports.set(
|
||||
fileExports,
|
||||
typeof req.resolve === 'function' ? req.resolve(filename) : null
|
||||
);
|
||||
} else if (typeof req === 'function') {
|
||||
const fileExports = req();
|
||||
currentExports.set(fileExports, null);
|
||||
} else if (typeof req === 'object') {
|
||||
const fileExports = req;
|
||||
currentExports.set(fileExports, null);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user