-
Notifications
You must be signed in to change notification settings - Fork 32
/
main.js
72 lines (64 loc) · 1.51 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const { dirname, join } = require('path')
const newRelic = require('./newRelic')
function getAbsolutePath(value) {
return dirname(require.resolve(join(value, 'package.json')))
}
module.exports = {
addons: [
{
name: '@storybook/addon-docs',
options: {
configureJSX: true,
},
},
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('@storybook/addon-a11y'),
'@storybook/addon-webpack5-compiler-babel',
],
previewHead: (head) => `
${head}
${process.env.NETLIFY ? newRelic.script : ''}
`,
webpackFinal: (config) => {
// Transpile Downshift for IE11 compatibility
return {
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{
test: /\.m?js$/,
include: /node_modules\/downshift\//,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
],
},
}
},
stories: ['../src/**/*.stories.tsx', '../src/**/*.mdx'],
staticDirs: [
'../src/forms/images',
'../src/tokens/images',
'../src/intro/static',
],
framework: {
name: getAbsolutePath('@storybook/react-webpack5'),
options: {
strictMode: false,
},
},
docs: {
autodocs: true,
},
typescript: {
reactDocgen: 'react-docgen',
},
}