@storybook/source-loader
Source loader
Last updated 3 days ago by shilman .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @storybook/source-loader 
SYNC missed versions from official npm registry.

Source Loader

Storybook source-loader is a webpack loader that annotates Storybook story files with their source code. It powers the storysource and docs addons.

Options

The loader can be customized with the following options:

parser

The parser that will be parsing your code to AST (based on prettier)

Allowed values:

  • javascript - default
  • typescript
  • flow

Be sure to update the regex test for the webpack rule if utilizing Typescript files.

Usage:

module.exports = function ({ config }) {
  config.module.rules.push({
    test: /\.stories\.tsx?$/,
    loaders: [
      {
        loader: require.resolve('@storybook/source-loader'),
        options: { parser: 'typescript' },
      },
    ],
    enforce: 'pre',
  });

  return config;
};

prettierConfig

The prettier configuration that will be used to format the story source in the addon panel.

Defaults:

{
  printWidth: 100,
  tabWidth: 2,
  bracketSpacing: true,
  trailingComma: 'es5',
  singleQuote: true,
}

Usage:

module.exports = function ({ config }) {
  config.module.rules.push({
    test: /\.stories\.jsx?$/,
    loaders: [
      {
        loader: require.resolve('@storybook/source-loader'),
        options: {
          prettierConfig: {
            printWidth: 100,
            singleQuote: false,
          },
        },
      },
    ],
    enforce: 'pre',
  });

  return config;
};

uglyCommentsRegex

The array of regex that is used to remove "ugly" comments.

Defaults:

[/^eslint-.*/, /^global.*/];

Usage:

module.exports = function ({ config }) {
  config.module.rules.push({
    test: /\.stories\.jsx?$/,
    loaders: [
      {
        loader: require.resolve('@storybook/source-loader'),
        options: {
          uglyCommentsRegex: [/^eslint-.*/, /^global.*/],
        },
      },
    ],
    enforce: 'pre',
  });

  return config;
};

injectDecorator

Tell storysource whether you need inject decorator. If false, you need to add the decorator by yourself;

Defaults: true

Usage:

module.exports = function ({ config }) {
  config.module.rules.push({
    test: /\.stories\.jsx?$/,
    loaders: [
      {
        loader: require.resolve('@storybook/source-loader'),
        options: { injectDecorator: false },
      },
    ],
    enforce: 'pre',
  });

  return config;
};

Current Tags

  • 6.0.27                                ...           latest (3 days ago)
  • 6.1.0-alpha.29                                ...           next (3 days ago)

372 Versions

  • 6.1.0-alpha.29                                ...           3 days ago
  • 6.0.27                                ...           3 days ago
  • 6.1.0-alpha.28                                ...           3 days ago
  • 6.1.0-alpha.27                                ...           7 days ago
  • 6.1.0-alpha.26                                ...           8 days ago
  • 6.1.0-alpha.25                                ...           10 days ago
  • 6.1.0-alpha.24                                ...           11 days ago
  • 6.1.0-alpha.23                                ...           14 days ago
  • 6.1.0-alpha.22                                ...           16 days ago
  • 6.1.0-alpha.21                                ...           18 days ago
  • 6.0.26                                ...           21 days ago
  • 6.1.0-alpha.20                                ...           21 days ago
  • 6.0.25                                ...           23 days ago
  • 6.0.24                                ...           23 days ago
  • 6.0.23                                ...           23 days ago
  • 6.1.0-alpha.19                                ...           23 days ago
  • 6.1.0-alpha.18                                ...           a month ago
  • 6.1.0-alpha.17                                ...           a month ago
  • 6.0.22                                ...           a month ago
  • 6.1.0-alpha.16                                ...           a month ago
  • 6.1.0-alpha.15                                ...           a month ago
  • 6.1.0-alpha.14                                ...           a month ago
  • 6.1.0-alpha.12                                ...           a month ago
  • 6.1.0-alpha.11                                ...           a month ago
  • 6.1.0-alpha.10                                ...           a month ago
  • 6.1.0-alpha.9                                ...           a month ago
  • 6.1.0-alpha.8                                ...           a month ago
  • 6.1.0-alpha.7                                ...           2 months ago
  • 6.1.0-alpha.6                                ...           2 months ago
  • 6.1.0-alpha.4                                ...           2 months ago
  • 6.1.0-alpha.3                                ...           2 months ago
  • 6.1.0-alpha.1                                ...           2 months ago
  • 6.1.0-alpha.0                                ...           2 months ago
  • 6.0.21                                ...           2 months ago
  • 6.0.20                                ...           2 months ago
  • 5.3.21                                ...           2 months ago
  • 6.0.19                                ...           2 months ago
  • 5.3.20                                ...           2 months ago
  • 6.0.18                                ...           2 months ago
  • 6.0.17                                ...           2 months ago
  • 6.0.16                                ...           2 months ago
  • 6.0.15                                ...           2 months ago
  • 6.0.14                                ...           2 months ago
  • 6.0.13                                ...           2 months ago
  • 6.0.12                                ...           2 months ago
  • 6.0.11                                ...           2 months ago
  • 6.0.10                                ...           2 months ago
  • 6.0.9                                ...           2 months ago
  • 6.0.7                                ...           2 months ago
  • 6.0.6                                ...           2 months ago
  • 6.0.5                                ...           2 months ago
  • 6.0.4                                ...           2 months ago
  • 6.0.3                                ...           2 months ago
  • 6.0.2                                ...           2 months ago
  • 6.0.1                                ...           2 months ago
  • 6.0.0                                ...           2 months ago
  • 6.0.0-rc.30                                ...           3 months ago
  • 6.0.0-rc.29                                ...           3 months ago
  • 6.0.0-rc.28                                ...           3 months ago
  • 6.0.0-rc.27                                ...           3 months ago
  • 6.0.0-rc.26                                ...           3 months ago
  • 6.0.0-rc.25                                ...           3 months ago
  • 6.0.0-rc.24                                ...           3 months ago
  • 6.0.0-rc.23                                ...           3 months ago
  • 6.0.0-rc.22                                ...           3 months ago
  • 6.0.0-rc.21                                ...           3 months ago
  • 6.0.0-rc.20                                ...           3 months ago
  • 6.0.0-rc.19                                ...           3 months ago
  • 6.0.0-rc.18                                ...           3 months ago
  • 6.0.0-rc.16                                ...           3 months ago
  • 6.0.0-rc.15                                ...           3 months ago
  • 6.0.0-rc.14                                ...           3 months ago
  • 6.0.0-rc.13                                ...           3 months ago
  • 6.0.0-rc.12                                ...           3 months ago
  • 6.0.0-rc.11                                ...           3 months ago
  • 6.0.0-rc.10                                ...           3 months ago
  • 6.0.0-rc.9                                ...           3 months ago
  • 6.0.0-rc.8                                ...           3 months ago
  • 6.0.0-rc.5                                ...           3 months ago
  • 6.0.0-rc.3                                ...           3 months ago
  • 6.0.0-rc.2                                ...           4 months ago
  • 6.0.0-rc.1                                ...           4 months ago
  • 6.0.0-rc.0                                ...           4 months ago
  • 6.0.0-beta.46                                ...           4 months ago
  • 6.0.0-beta.45                                ...           4 months ago
  • 6.0.0-beta.44                                ...           4 months ago
  • 6.0.0-beta.43                                ...           4 months ago
  • 6.0.0-beta.42                                ...           4 months ago
  • 6.0.0-beta.41                                ...           4 months ago
  • 6.0.0-beta.40                                ...           4 months ago
  • 6.0.0-beta.39                                ...           4 months ago
  • 6.0.0-beta.38                                ...           4 months ago
  • 6.0.0-beta.37                                ...           4 months ago
  • 6.0.0-beta.36                                ...           4 months ago
  • 6.0.0-beta.35                                ...           4 months ago
  • 6.0.0-beta.34                                ...           4 months ago
  • 6.0.0-beta.33                                ...           4 months ago
  • 6.0.0-beta.32                                ...           4 months ago
  • 6.0.0-beta.31                                ...           4 months ago
  • 6.0.0-beta.30                                ...           4 months ago
  • 6.0.0-beta.29                                ...           4 months ago
  • 6.0.0-beta.28                                ...           4 months ago
  • 6.0.0-beta.27                                ...           4 months ago
  • 6.0.0-beta.26                                ...           4 months ago
  • 6.0.0-beta.25                                ...           4 months ago
  • 6.0.0-beta.24                                ...           4 months ago
  • 6.0.0-beta.23                                ...           5 months ago
  • 6.0.0-beta.22                                ...           5 months ago
  • 6.0.0-beta.21                                ...           5 months ago
  • 6.0.0-beta.20                                ...           5 months ago
  • 6.0.0-beta.19                                ...           5 months ago
  • 6.0.0-beta.18                                ...           5 months ago
  • 6.0.0-beta.17                                ...           5 months ago
  • 6.0.0-beta.16                                ...           5 months ago
  • 6.0.0-beta.15                                ...           5 months ago
  • 6.0.0-beta.14                                ...           5 months ago
  • 5.3.19                                ...           5 months ago
  • 6.0.0-beta.13                                ...           5 months ago
  • 6.0.0-beta.12                                ...           5 months ago
  • 6.0.0-beta.11                                ...           5 months ago
  • 6.0.0-beta.9                                ...           5 months ago
  • 6.0.0-beta.8                                ...           5 months ago
  • 6.0.0-beta.7                                ...           5 months ago
  • 6.0.0-beta.6                                ...           5 months ago
  • 6.0.0-beta.5                                ...           5 months ago
  • 6.0.0-beta.4                                ...           6 months ago
  • 6.0.0-beta.3                                ...           6 months ago
  • 6.0.0-beta.2                                ...           6 months ago
  • 6.0.0-beta.1                                ...           6 months ago
  • 6.0.0-beta.0                                ...           6 months ago
  • 6.0.0-alpha.46                                ...           6 months ago
  • 6.0.0-alpha.45                                ...           6 months ago
  • 6.0.0-alpha.44                                ...           6 months ago
  • 6.0.0-alpha.43                                ...           6 months ago
  • 6.0.0-alpha.42                                ...           6 months ago
  • 6.0.0-alpha.41                                ...           6 months ago
  • 6.0.0-alpha.40                                ...           6 months ago
  • 6.0.0-alpha.39                                ...           6 months ago
  • 6.0.0-alpha.37                                ...           6 months ago
  • 6.0.0-alpha.36                                ...           6 months ago
  • 6.0.0-alpha.35                                ...           6 months ago
  • 6.0.0-alpha.34                                ...           6 months ago
  • 6.0.0-alpha.33                                ...           6 months ago
  • 6.0.0-alpha.32                                ...           6 months ago
  • 6.0.0-alpha.31                                ...           7 months ago
  • 5.3.18                                ...           7 months ago
  • 6.0.0-alpha.30                                ...           7 months ago
  • 6.0.0-alpha.29                                ...           7 months ago
  • 6.0.0-alpha.28                                ...           7 months ago
  • 5.3.17                                ...           7 months ago
  • 5.3.15                                ...           7 months ago
  • 6.0.0-alpha.27                                ...           7 months ago
  • 6.0.0-alpha.26                                ...           7 months ago
  • 6.0.0-alpha.25                                ...           7 months ago
  • 6.0.0-alpha.24                                ...           7 months ago
  • 6.0.0-alpha.22                                ...           8 months ago
  • 6.0.0-alpha.21                                ...           8 months ago
  • 6.0.0-alpha.20                                ...           8 months ago
  • 5.3.14                                ...           8 months ago
  • 6.0.0-alpha.19                                ...           8 months ago
  • 6.0.0-alpha.18                                ...           8 months ago
  • 6.0.0-alpha.17                                ...           8 months ago
  • 6.0.0-alpha.15                                ...           8 months ago
  • 6.0.0-alpha.14                                ...           8 months ago
  • 6.0.0-alpha.13                                ...           8 months ago
  • 6.0.0-alpha.12                                ...           8 months ago
  • 6.0.0-alpha.11                                ...           8 months ago
  • 5.3.13                                ...           8 months ago
  • 6.0.0-alpha.10                                ...           8 months ago
  • 6.0.0-alpha.9                                ...           9 months ago
  • 6.0.0-alpha.8                                ...           9 months ago
  • 6.0.0-alpha.7                                ...           9 months ago
  • 6.0.0-alpha.6                                ...           9 months ago
  • 5.3.12                                ...           9 months ago
  • 5.3.11                                ...           9 months ago
  • 6.0.0-alpha.5                                ...           9 months ago
  • 6.0.0-alpha.4                                ...           9 months ago
  • 5.3.10                                ...           9 months ago
  • 6.0.0-alpha.3                                ...           9 months ago
  • 6.0.0-alpha.2                                ...           9 months ago
  • 5.3.9                                ...           9 months ago
  • 6.0.0-alpha.1                                ...           9 months ago
  • 5.3.8                                ...           9 months ago
  • 6.0.0-alpha.0                                ...           9 months ago
  • 5.3.7                                ...           9 months ago
  • 5.3.6                                ...           9 months ago
  • 5.3.5                                ...           9 months ago
  • 5.3.4                                ...           9 months ago
  • 5.3.3                                ...           9 months ago
  • 5.3.2                                ...           9 months ago
  • 5.3.1                                ...           9 months ago
  • 5.3.0                                ...           9 months ago
  • 5.3.0-rc.14                                ...           9 months ago
  • 5.3.0-rc.13                                ...           9 months ago
  • 5.3.0-rc.12                                ...           10 months ago
  • 5.3.0-rc.11                                ...           10 months ago
  • 5.3.0-rc.10                                ...           10 months ago
  • 5.3.0-rc.9                                ...           10 months ago
  • 5.3.0-rc.8                                ...           10 months ago
  • 5.3.0-rc.7                                ...           10 months ago
  • 5.3.0-rc.6                                ...           10 months ago
  • 5.3.0-rc.5                                ...           10 months ago
  • 5.3.0-rc.4                                ...           10 months ago
  • 5.3.0-rc.3                                ...           10 months ago
  • 5.3.0-rc.1                                ...           10 months ago
  • 5.3.0-rc.0                                ...           10 months ago
  • 5.3.0-beta.31                                ...           10 months ago
  • 5.3.0-beta.26                                ...           10 months ago
  • 5.3.0-beta.30                                ...           10 months ago
  • 5.3.0-beta.29                                ...           10 months ago
  • 5.3.0-beta.28                                ...           10 months ago
  • 5.3.0-beta.27                                ...           10 months ago
  • 5.3.0-beta.25                                ...           10 months ago
  • 5.3.0-beta.23                                ...           10 months ago
  • 5.3.0-beta.22                                ...           10 months ago
  • 5.3.0-beta.21                                ...           a year ago
  • 5.3.0-beta.20                                ...           a year ago
  • 5.3.0-beta.19                                ...           a year ago
  • 5.3.0-beta.18                                ...           a year ago
  • 5.3.0-beta.17                                ...           a year ago
  • 5.3.0-beta.16                                ...           a year ago
  • 5.3.0-beta.15                                ...           a year ago
  • 5.2.8                                ...           a year ago
  • 5.3.0-beta.14                                ...           a year ago
  • 5.2.7                                ...           a year ago
  • 5.3.0-beta.13                                ...           a year ago
  • 5.3.0-beta.12                                ...           a year ago
  • 5.3.0-beta.11                                ...           a year ago
  • 5.3.0-beta.10                                ...           a year ago
  • 5.3.0-beta.9                                ...           a year ago
  • 5.3.0-beta.8                                ...           a year ago
  • 5.3.0-beta.6                                ...           a year ago
  • 5.3.0-beta.3                                ...           a year ago
  • 5.3.0-beta.2                                ...           a year ago
  • 5.3.0-beta.1                                ...           a year ago
  • 5.3.0-beta.0                                ...           a year ago
  • 5.3.0-alpha.47                                ...           a year ago
  • 5.3.0-alpha.46                                ...           a year ago
  • 5.3.0-alpha.45                                ...           a year ago
  • 5.3.0-alpha.44                                ...           a year ago
  • 5.3.0-alpha.43                                ...           a year ago
  • 5.2.6                                ...           a year ago
  • 5.3.0-alpha.42                                ...           a year ago
  • 5.3.0-alpha.41                                ...           a year ago
  • 5.3.0-alpha.40                                ...           a year ago
  • 5.3.0-alpha.39                                ...           a year ago
  • 5.3.0-alpha.38                                ...           a year ago
  • 5.3.0-alpha.37                                ...           a year ago
  • 5.3.0-alpha.36                                ...           a year ago
  • 5.3.0-alpha.35                                ...           a year ago
  • 5.3.0-alpha.34                                ...           a year ago
  • 5.3.0-alpha.33                                ...           a year ago
  • 5.3.0-alpha.32                                ...           a year ago
  • 5.3.0-alpha.31                                ...           a year ago
  • 5.3.0-alpha.30                                ...           a year ago
  • 5.3.0-alpha.29                                ...           a year ago
  • 5.3.0-alpha.28                                ...           a year ago
  • 5.3.0-alpha.27                                ...           a year ago
  • 5.3.0-alpha.26                                ...           a year ago
  • 5.3.0-alpha.25                                ...           a year ago
  • 5.3.0-alpha.24                                ...           a year ago
  • 5.2.5                                ...           a year ago
  • 5.3.0-alpha.23                                ...           a year ago
  • 5.3.0-alpha.22                                ...           a year ago
  • 5.3.0-alpha.21                                ...           a year ago
  • 5.3.0-alpha.20                                ...           a year ago
  • 5.3.0-alpha.19                                ...           a year ago
  • 5.2.4                                ...           a year ago
  • 5.3.0-alpha.18                                ...           a year ago
  • 5.3.0-alpha.17                                ...           a year ago
  • 5.3.0-alpha.15                                ...           a year ago
  • 5.3.0-alpha.13                                ...           a year ago
  • 5.3.0-alpha.12                                ...           a year ago
  • 5.2.3                                ...           a year ago
  • 5.2.2                                ...           a year ago
  • 5.3.0-alpha.11                                ...           a year ago
  • 5.3.0-alpha.10                                ...           a year ago
  • 5.3.0-alpha.9                                ...           a year ago
  • 5.3.0-alpha.7                                ...           a year ago
  • 5.3.0-alpha.6                                ...           a year ago
  • 5.3.0-alpha.5                                ...           a year ago
  • 5.3.0-alpha.4                                ...           a year ago
  • 5.3.0-alpha.3                                ...           a year ago
  • 5.3.0-alpha.2                                ...           a year ago
  • 5.3.0-alpha.1                                ...           a year ago
  • 5.2.1                                ...           a year ago
  • 5.3.0-alpha.0                                ...           a year ago
  • 5.2.0                                ...           a year ago
  • 5.2.0-rc.11                                ...           a year ago
  • 5.2.0-rc.10                                ...           a year ago
  • 5.2.0-rc.9                                ...           a year ago
  • 5.2.0-rc.8                                ...           a year ago
  • 5.2.0-rc.6                                ...           a year ago
  • 5.2.0-rc.5                                ...           a year ago
  • 5.2.0-rc.4                                ...           a year ago
  • 5.2.0-rc.2                                ...           a year ago
  • 5.2.0-rc.1                                ...           a year ago
  • 5.2.0-rc.0                                ...           a year ago
  • 5.2.0-beta.48                                ...           a year ago
  • 5.2.0-beta.47                                ...           a year ago
  • 5.2.0-beta.46                                ...           a year ago
  • 5.2.0-beta.45                                ...           a year ago
  • 5.2.0-beta.43                                ...           a year ago
  • 5.2.0-beta.42                                ...           a year ago
  • 5.2.0-beta.41                                ...           a year ago
  • 5.2.0-beta.40                                ...           a year ago
  • 5.2.0-beta.39                                ...           a year ago
  • 5.2.0-beta.38                                ...           a year ago
  • 5.2.0-beta.37                                ...           a year ago
  • 5.2.0-beta.36                                ...           a year ago
  • 5.2.0-beta.33                                ...           a year ago
  • 5.2.0-beta.32                                ...           a year ago
  • 5.2.0-beta.31                                ...           a year ago
  • 5.2.0-beta.30                                ...           a year ago
  • 5.2.0-beta.29                                ...           a year ago
  • 5.2.0-beta.28                                ...           a year ago
  • 5.2.0-beta.26                                ...           a year ago
  • 5.2.0-beta.25                                ...           a year ago
  • 5.2.0-beta.24                                ...           a year ago
  • 5.2.0-beta.23                                ...           a year ago
  • 5.2.0-beta.22                                ...           a year ago
  • 5.2.0-beta.21                                ...           a year ago
  • 5.2.0-beta.20                                ...           a year ago
  • 5.2.0-beta.19                                ...           a year ago
  • 5.2.0-beta.18                                ...           a year ago
  • 5.2.0-beta.17                                ...           a year ago
  • 5.2.0-beta.16                                ...           a year ago
  • 5.2.0-beta.15                                ...           a year ago
  • 5.2.0-beta.14                                ...           a year ago
  • 5.2.0-beta.13                                ...           a year ago
  • 5.2.0-beta.12                                ...           a year ago
  • 5.2.0-beta.10                                ...           a year ago
  • 5.2.0-beta.9                                ...           a year ago
  • 5.2.0-beta.8                                ...           a year ago
  • 5.2.0-beta.7                                ...           a year ago
  • 5.2.0-beta.6                                ...           a year ago
  • 5.2.0-beta.5                                ...           a year ago
  • 5.2.0-beta.4                                ...           a year ago
  • 5.2.0-beta.3                                ...           a year ago
  • 5.2.0-beta.2                                ...           a year ago
  • 5.2.0-beta.1                                ...           a year ago
  • 5.2.0-beta.0                                ...           a year ago
  • 5.2.0-alpha.44                                ...           a year ago
  • 5.2.0-alpha.43                                ...           a year ago
  • 5.2.0-alpha.42                                ...           a year ago
  • 5.2.0-alpha.41                                ...           a year ago
  • 5.2.0-alpha.40                                ...           a year ago
  • 5.2.0-alpha.39                                ...           a year ago
  • 5.2.0-alpha.38                                ...           a year ago
  • 5.2.0-alpha.37                                ...           a year ago
  • 5.2.0-alpha.36                                ...           a year ago
  • 5.2.0-alpha.35                                ...           a year ago
  • 5.2.0-alpha.34                                ...           a year ago
  • 5.2.0-alpha.33                                ...           a year ago
  • 5.2.0-alpha.32                                ...           a year ago
  • 5.2.0-alpha.31                                ...           a year ago
  • 5.2.0-alpha.30                                ...           a year ago
  • 5.2.0-alpha.29                                ...           a year ago
  • 5.2.0-alpha.28                                ...           a year ago
  • 5.2.0-alpha.27                                ...           a year ago
  • 5.2.0-alpha.26                                ...           a year ago
  • 5.2.0-alpha.24                                ...           a year ago
  • 5.2.0-alpha.23                                ...           a year ago
  • 5.2.0-alpha.22                                ...           a year ago
  • 5.2.0-alpha.21                                ...           a year ago
  • 5.2.0-alpha.20                                ...           a year ago
  • 5.2.0-alpha.19                                ...           a year ago
  • 5.2.0-alpha.18                                ...           a year ago
  • 5.2.0-alpha.17                                ...           a year ago
  • 5.2.0-alpha.16                                ...           a year ago
  • 5.2.0-alpha.15                                ...           a year ago
  • 5.2.0-alpha.14                                ...           a year ago

Copyright 2014 - 2016 © taobao.org |