Add source code addon to Storybook

[MAILPOET-2769]
This commit is contained in:
Ján Mikláš
2020-04-18 18:48:28 +02:00
committed by Veljko V
parent 6dcac2ebe5
commit eb93681f0a
3 changed files with 152 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
const path = require('path');
module.exports = {
stories: ['../assets/js/src/**/_stories/*.tsx'],
addons: [
@@ -5,5 +7,17 @@ module.exports = {
'@storybook/addon-links',
'@storybook/preset-typescript',
'storybook-addon-performance/register',
{
name: '@storybook/addon-storysource',
options: {
rule: {
test: [/_stories\/.*\.tsx?$/],
include: [path.resolve(__dirname, '../assets/js/src')],
},
loaderOptions: {
parser: 'typescript',
},
},
},
],
};