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

14 lines
381 B
JavaScript

function managerEntries(entry = [], options) {
return [...entry, require.resolve('./dist/esm/register')];
}
function config(entry = [], { addDecorator = true } = {}) {
const knobsConfig = [];
if (addDecorator) {
knobsConfig.push(require.resolve('./dist/esm/preset/addDecorator'));
}
return [...entry, ...knobsConfig];
}
module.exports = { managerEntries, config };