Skip to content

Commit

Permalink
simplify main.js format for javascript projects
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jan 30, 2023
1 parent 6ff9672 commit 32fe707
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions code/lib/cli/src/generators/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ export async function configureMain({
const tsTemplate = dedent`<<import>>const config<<type>> = <<mainContents>>;
export default config;`;

const jsTemplate = dedent`const config = <<mainContents>>
export default config;`;
const jsTemplate = dedent`export default <<mainContents>>;`;

const finalTemplate = isTypescript ? tsTemplate : jsTemplate;

Expand All @@ -62,9 +61,7 @@ export async function configureMain({

await fse.writeFile(
`./${storybookConfigFolder}/main.${isTypescript ? 'ts' : 'js'}`,
dedent`
${mainJsContents}
`,
dedent(mainJsContents),
{ encoding: 'utf8' }
);
}
Expand Down

0 comments on commit 32fe707

Please sign in to comment.