mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 15:31:16 +08:00
Core: Enable community builders
This commit is contained in:
parent
9e3fce549f
commit
bcad85653d
@ -8,7 +8,10 @@ export async function getPreviewBuilder(configDir: Options['configDir']) {
|
||||
const mainFile = getInterpretedFile(main);
|
||||
const { core } = mainFile ? serverRequire(mainFile) : { core: null };
|
||||
const builder = core?.builder || DEFAULT_WEBPACK;
|
||||
const builderPackage = ['webpack4', 'webpack5'].includes(builder)
|
||||
? `@storybook/builder-${builder}`
|
||||
: builder;
|
||||
|
||||
const previewBuilder = await import(`@storybook/builder-${builder}`);
|
||||
const previewBuilder = await import(builderPackage);
|
||||
return previewBuilder;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user