Fix detection of type: module when initializing storybook

This commit is contained in:
Ian VanSchooten 2022-07-14 09:43:01 -04:00
parent 64ede83903
commit 653a9ffe65

View File

@ -12,6 +12,7 @@ export type GeneratorOptions = {
language: SupportedLanguage; language: SupportedLanguage;
builder: Builder; builder: Builder;
linkable: boolean; linkable: boolean;
commonJs: boolean;
}; };
export interface FrameworkOptions { export interface FrameworkOptions {
@ -67,7 +68,7 @@ const hasInteractiveStories = (framework: SupportedFrameworks) =>
export async function baseGenerator( export async function baseGenerator(
packageManager: JsPackageManager, packageManager: JsPackageManager,
npmOptions: NpmOptions, npmOptions: NpmOptions,
{ language, builder }: GeneratorOptions, { language, builder, commonJs }: GeneratorOptions,
framework: SupportedFrameworks, framework: SupportedFrameworks,
options: FrameworkOptions = defaultOptions options: FrameworkOptions = defaultOptions
) { ) {
@ -150,7 +151,7 @@ export async function baseGenerator(
framework: frameworkPackage, framework: frameworkPackage,
addons: [...addons, ...stripVersions(extraAddons)], addons: [...addons, ...stripVersions(extraAddons)],
extensions, extensions,
commonJs: options.commonJs, commonJs,
...mainOptions, ...mainOptions,
}); });
if (addComponents) { if (addComponents) {