How to use the @storybook/postinstall.presetsAddPreset function in @storybook/postinstall

To help you get started, we’ve selected a few @storybook/postinstall 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 storybookjs / storybook / addons / docs / postinstall / presets.js View on Github external
const { dependencies, devDependencies } = packageJson;
  if (
    framework === 'react' &&
    ((dependencies && dependencies['react-scripts']) ||
      (devDependencies && devDependencies['react-scripts']))
  ) {
    presetOptions = {
      configureJSX: true,
    };
  }

  const j = api.jscodeshift;
  const root = j(file.source);

  presetsAddPreset(`@storybook/addon-docs/preset`, presetOptions, { root, api });

  return root.toSource({ quote: 'single' });
}

@storybook/postinstall

Storybook addons postinstall utilities

MIT
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis