File tree Expand file tree Collapse file tree 4 files changed +34
-7
lines changed Expand file tree Collapse file tree 4 files changed +34
-7
lines changed Original file line number Diff line number Diff line change
1
+ import 'storybook-readme/register' ;
2
+ import '@storybook/addon-knobs/register' ;
3
+ import '@storybook/addon-viewport/register' ;
1
4
import '@storybook/addon-actions/register' ;
2
- import '@storybook/addon-links /register' ;
5
+ import '@storybook/addon-options /register' ;
Original file line number Diff line number Diff line change 1
- import { configure } from '@storybook/react' ;
1
+ import React from 'react' ;
2
+ import { addDecorator , configure } from '@storybook/react' ;
3
+ import { withKnobs } from '@storybook/addon-knobs' ;
4
+ import { withViewport } from '@storybook/addon-viewport' ;
5
+ import { withOptions } from '@storybook/addon-options' ;
2
6
3
- // automatically import all files ending in *.stories.js
4
- const req = require . context ( '../src' , true , / .s t o r i e s .t s x $ / ) ;
7
+ // inject custom css to all stories
8
+ addDecorator ( story => (
9
+ < div style = { { fontFamily : '"Roboto", sans-serif' } } > { story ( ) } </ div >
10
+ ) ) ;
11
+
12
+ // setup global addons
13
+ addDecorator ( withKnobs ) ;
14
+ addDecorator ( withViewport ) ;
15
+ addDecorator (
16
+ withOptions ( {
17
+ name : 'Doc UI' ,
18
+ url : 'https://github.com/shockits/doc-ui' ,
19
+ } )
20
+ ) ;
21
+
22
+ // automatically import all storybook files
23
+ const req = require . context ( '../src' , true , / .s t o r i e s .( t s | t s x ) $ / ) ;
5
24
function loadStories ( ) {
6
25
req . keys ( ) . forEach ( filename => req ( filename ) ) ;
7
26
}
Original file line number Diff line number Diff line change
1
+ < link
2
+ href ="https://fonts.googleapis.com/css?family=Roboto:400,500,700 "
3
+ rel ="stylesheet "
4
+ />
Original file line number Diff line number Diff line change 1
- const path = require ( 'path' ) ;
2
-
3
1
module . exports = ( baseConfig , env , config ) => {
4
2
config . resolve . extensions . push ( '.ts' , '.tsx' ) ;
5
3
config . module . rules . push ( {
6
4
test : / \. ( t s | t s x ) $ / ,
7
5
exclude : / n o d e _ m o d u l e s / ,
8
- loader : require . resolve ( 'awesome-typescript-loader' ) ,
6
+ loaders : [
7
+ require . resolve ( 'babel-loader' ) ,
8
+ require . resolve ( 'awesome-typescript-loader' ) ,
9
+ ] ,
9
10
} ) ;
10
11
11
12
return config ;
You can’t perform that action at this time.
0 commit comments