Wondering what’s next for npm?Check out our public roadmap! »

    storybook-preset-craco

    0.0.4 • Public • Published

    Craco preset for Storybook

    One-line craco configuration for Storybook.

    This preset is designed to use alongside @storybook/react.

    Basic usage

    First, install this preset to your project.

    # Yarn
    yarn add -D storybook-preset-craco
    
    # npm
    npm install -D storybook-preset-craco

    Once installed, add this preset to the appropriate file:

    • ./.storybook/main.js

      module.exports = {
        addons: ["storybook-preset-craco"],
      };

    Advanced usage

    Usage with Docs

    When working with Storybook Docs, simply add the following config to your main.js file.

    module.exports = {
      addons: [
        "storybook-preset-craco",
        {
          name: "@storybook/addon-docs",
          options: {
            configureJSX: true,
          },
        },
      ],
    };

    Custom craco.config.js

    In most cases, this preset will look for your craco.config.js in the current working directory.

    If you are using a non standard project layout then you can provide it in cracoConfigFile.

    module.exports = {
      addons: [
        {
          name: "storybook-preset-craco",
          options: {
            cracoConfigFile: "../craco.config.js",
          },
        },
      ],
    };

    Keywords

    none

    Install

    npm i storybook-preset-craco

    DownloadsWeekly Downloads

    1,174

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    8.87 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar