-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
71 lines (65 loc) · 2.6 KB
/
main.js
File metadata and controls
71 lines (65 loc) · 2.6 KB
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
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
import path from 'path';
import { fileURLToPath } from 'url';
const currDir = path.dirname(fileURLToPath(import.meta.url));
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
const config = {
stories: ['../packages/**/*.stories.@(js|jsx|mjs|ts|tsx)', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
staticDirs: ['../packages/assets/src/', '../assets/'],
addons: [
'@storybook/addon-docs',
'@storybook/addon-webpack5-compiler-swc',
'@storybook/addon-a11y',
'storybook-addon-pseudo-states',
{
name: '@storybook/addon-coverage',
options: {
istanbul: {
exclude: ['**/.storybook/**', '**/*.stories.*', '**/storybook-static/**', '**/storybook/**'],
},
},
},
{
name: '@storybook/addon-styling-webpack',
options: {
rules: [
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
],
},
},
path.resolve(currDir, '../src/storybook/addons/framework-selector/index.ts'),
'@chromatic-com/storybook',
],
framework: {
name: '@storybook/react-webpack5',
options: {},
},
typescript: {
check: true,
reactDocgen: 'react-docgen-typescript',
},
webpackFinal: async (webpackConfig) => {
webpackConfig.module.rules.push({
test: /\.xliff$/,
use: ['raw-loader'],
});
webpackConfig.resolve.alias = {
...webpackConfig.resolve.alias,
'@ids-components': path.resolve(currDir, '../packages/components/src/components'),
'@ids-context': path.resolve(currDir, '../packages/components/src/context'),
'@ids-hoc': path.resolve(currDir, '../packages/components/src/hoc'),
'@ids-hooks': path.resolve(currDir, '../packages/components/src/hooks'),
'@ids-partials': path.resolve(currDir, '../packages/components/src/partials'),
'@ids-sb-decorators': path.resolve(currDir, '../src/storybook/decorators'),
'@ids-sb-utils': path.resolve(currDir, '../src/storybook/utils'),
'@ids-shared': path.resolve(currDir, '../packages/components/src/shared'),
'@ids-core': path.resolve(currDir, '../packages/core/src'),
};
webpackConfig.plugins.push(new NodePolyfillPlugin());
return webpackConfig;
},
};
export default config;