@storybook-addons/source-loader
v1.1.2
Published
Source loader for storybook stories
Downloads
4
Maintainers
Readme
@storybook-addons/source-loader ·
Webpack-loader for story sources at docs page.
Why not native source-loader? Because them have issue with shorthand parameters.
Install
npm i -D @storybook-addons/source-loader
Usage
Add loader for webpack rules at before ts or babel loaders:
module.exports = {
module: {
rules: [
{
test: /\.tsx/,
use: 'ts-loader',
},
{
test: /\.examples\.tsx/,
use: '@storybook-addons/source-loader',
},
],
},
}
Options
A source-loader supports prettier for formatting source code:
module.exports = {
module: {
rules: [
{
test: /\.examples\.tsx/,
loader: '@storybook-addons/source-loader',
options: {
prettier: {
printWidth: 100,
},
},
},
],
},
}
License
Project is MIT licensed.