Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle size analysis missing for prebuilt manager #15122

Open
ghengeveld opened this issue Jun 2, 2021 · 4 comments
Open

Bundle size analysis missing for prebuilt manager #15122

ghengeveld opened this issue Jun 2, 2021 · 4 comments

Comments

@ghengeveld
Copy link
Member

ghengeveld commented Jun 2, 2021

We used to generate a bundle size report when compiling the prebuilt manager. This was removed/disabled in the webpack4/5 split. We should restore it.

Original PR introducing this feature: #13425
It got disabled here: 4eabfd4
Note that we are now building two prebuilt managers, for both webpack4 and webpack5.

@ndelangen
Copy link
Member

ndelangen commented Jan 17, 2023

This seems like an easy task to be picked up by a new contributor!

I recon the implementation could be that after running build-storybook we print a report similar to the one we print when storybook is started in dev mode:

╭────────────────────────────────────────────────────╮
│                                                    │
│   Storybook 7.0.0-beta.29 for react-vite built     │
│   7.52 s for preview ( 2.6 mb )                    │
│   2.59 s for manager ( 1.3 mb )                    │
│                                                    │
│   Directory:                                       │
│   "./storybook-static"                             │
│                                                    │
│   You could host it with any http server:          │
│   "npx http-server ./storybook-static"             │
│                                                    │
╰────────────────────────────────────────────────────╯

We could also cleanup the CLI output a lot in the process when running build-storybook.

@ndelangen ndelangen removed their assignment Jan 17, 2023
@adityaKrModak
Copy link
Contributor

Please assign this issue to me.

@ndelangen
Copy link
Member

Consider it yours @adityaKrModak !

@ndelangen
Copy link
Member

I think the message should be logged somewhere here:

logger.info(`=> Output directory: ${options.outputDir}`);

You can gather the data by reading the file-system, I think.

Here's where we print the box for dev-mode:

console.log(
boxen(
dedent`
${colors.green(`Storybook ${chalk.bold(version)} for ${chalk.bold(name)} started`)}
${chalk.gray(timeStatement)}
${serveMessage.toString()}${updateMessage ? `\n\n${updateMessage}` : ''}
`,
{ borderStyle: 'round', padding: 1, borderColor: '#F1618C' } as any
)
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants