How to use the @storybook/react/standalone function in @storybook/react

To help you get started, we’ve selected a few @storybook/react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github umijs / father / packages / father / src / doc / storybook.ts View on Github external
export function devOrBuild({ cwd, cmd, DOC_PATH, args = {} }: Partial) {
  const { storybookPath } = generator(cwd);

  if (cmd === 'build') {
    return storybook({
      mode: 'static',
      outputDir: DOC_PATH,
      configDir: storybookPath,
    });
  } else {
    // Dev mode
    process.env.NODE_ENV = 'development';

    return storybook({
      mode: 'dev',
      port: args.port || 9001,
      configDir: storybookPath,
    });
  }
}
github curioswitch / curiostack / common / web / base-web / src / dev / scripts / build.ts View on Github external
await check();

  let result = await runWebpack(appConfiguration);
  if (result.stats.hasErrors()) {
    throw new Error();
  }
  if (prerenderConfiguration) {
    result = await runWebpack(prerenderConfiguration);
    if (result.stats.hasErrors()) {
      throw new Error();
    }
  }

  const storybookConfigDir = path.resolve(process.cwd(), '.storybook');
  if (fs.existsSync(storybookConfigDir)) {
    await storybook({
      mode: 'static',
      configDir: storybookConfigDir,
      outputDir: './build/storybook',
    });
  }
}