Skip to content

Commit

Permalink
Fix packageName check in build-dev
Browse files Browse the repository at this point in the history
The current check breaks for non-storybook packages.

`Array.split` always returns 1 items at minimum, so with a `> 0` check in there it always executed the "if" part, breaking on the `.split()[1]` after.
  • Loading branch information
ThaNarie committed Nov 29, 2021
1 parent 43e5940 commit bfb942b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core-server/src/build-dev.ts
Expand Up @@ -112,7 +112,7 @@ export async function buildDevStandalone(options: CLIOptions & LoadOptions & Bui
}

// Get package name and capitalize it e.g. @storybook/react -> React
const packageName = name.split('@storybook/').length > 0 ? name.split('@storybook/')[1] : name;
const packageName = name.split('@storybook/').length > 1 ? name.split('@storybook/')[1] : name;
const frameworkName = packageName.charAt(0).toUpperCase() + packageName.slice(1);

outputStartupInformation({
Expand Down

0 comments on commit bfb942b

Please sign in to comment.