Socket
Book a DemoInstallSign in
Socket

storybook-dep-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-dep-webpack-plugin

A webpack plugin to inject storybook dependencies

1.0.7
latest
Source
npmnpm
Version published
Weekly downloads
446
-2.62%
Maintainers
1
Weekly downloads
 
Created
Source

storybook-dep-webpack-plugin

A webpack plugin to collect dependencies data.
Works in conjunction with storybook-addon-deps

Dependencies plugin

Live demo

grommet-controls

Installation

npm i -D storybook-dep-webpack-plugin

Usage

You can register the plugin in two different ways

1. New way - inside your storybook main.js webpack settings you will register the plugin:

const DependenciesPlugin = require('storybook-dep-webpack-plugin');

module.exports = {
...
  webpack: async (config, { configType }) => ({
    ...config,
    plugins: [
      ...config.plugins,
      new DependenciesPlugin()
    ]
  }),
...
};

2. Older way - in your storybook webpack.config.js file, add and configure the plugin:

const DependenciesPlugin = require('storybook-dep-webpack-plugin');

module.exports = ({ config, mode }) => {
  ...
  config.plugins.push(new DependenciesPlugin());
  ...
  return config;
};

Options

filter - a RegExp or function to select the stories.
example:

  config.plugins.push(new DependenciesPlugin({
    filter: (resource) => {
      return /\.(stories|story)\.[tj]sx?$/.test(resource) && resource.indexOf("Avatar") > -1;
    }
  }));

exclude - a RegExp for the modules to exclude.
example:

  config.plugins.push(new DependenciesPlugin({
    filter: /^@storybook|@babel/,
  }));

maxLevels - How many levels deep to follow the dependencies.
example:

  config.plugins.push(new DependenciesPlugin({
    maxLevels: 10,
  }));

pickProperties - An array of the props to pick from the module webpack data.
example:

  config.plugins.push(new DependenciesPlugin({
    pickProperties: ['id', 'name', 'request'],
  }));

pickModuleProperties - An array of the props to pick from the module.module webpack data.
example:

  config.plugins.push(new DependenciesPlugin({
    pickModuleProperties: [],
  }));

Install and configure storybook-addon-deps

storybook-addon-deps

Keywords

addon

FAQs

Package last updated on 11 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.