storybook/addons/docs/common-preset.js
2021-02-03 22:34:44 +08:00

20 lines
539 B
JavaScript

function managerEntries(entry = [], options) {
return [...entry, require.resolve('./dist/esm/register')];
}
function config(entry = [], options = {}) {
const { framework } = options;
const docsConfig = [require.resolve('./dist/esm/frameworks/common/config')];
try {
docsConfig.push(require.resolve(`./dist/esm/frameworks/${framework}/config`));
} catch (err) {
// there is no custom config for the user's framework, do nothing
}
return [...docsConfig, ...entry];
}
module.exports = {
managerEntries,
config,
};