-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathmain.js
127 lines (123 loc) · 4.18 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
const path = require('path');
module.exports = {
stories: ['./stories/**/*.@(js|jsx|ts|tsx|mdx)'],
addons: ['@storybook/addon-docs', '@storybook/addon-links'],
staticDirs: ['./static'],
// due to storybook composition, chakra shows up as stories
// https://github.com/chakra-ui/chakra-ui/issues/2263#issuecomment-767557426
refs: {
'@chakra-ui/react': { disable: true },
},
framework: '@storybook/react',
core: {
builder: '@storybook/builder-vite',
disableTelemetry: true,
},
async viteFinal(config, { configType }) {
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
// You can change the configuration based on that.
// 'PRODUCTION' is used when building the static version of storybook.
// chakra does not show styles in storybook
// https://github.com/storybookjs/storybook/issues/13114#issuecomment-846464338
return {
...config,
build: {
...(config?.build ?? {}),
// https://github.com/storybookjs/builder-vite/issues/409
// https://github.com/vitejs/vite/issues/2433
sourcemap: false,
// minify: false,
rollupOptions: {
...(config?.build?.rollupOptions ?? {}),
maxParallelFileOps: 2,
cache: false,
output: {
sourcemap: false,
manualChunks: (id) => {
if (id.includes('node_modules')) {
return 'vendor';
}
},
},
},
},
resolve: {
...(config?.resolve ?? {}),
alias: [
{
find: '@table-library/react-table-library/types',
replacement: path.resolve(__dirname, '../src/types/'),
},
{
find: '@table-library/react-table-library/common',
replacement: path.resolve(__dirname, '../src/common/'),
},
{
find: '@table-library/react-table-library/table',
replacement: path.resolve(__dirname, '../src/table/'),
},
{
find: '@table-library/react-table-library/compact',
replacement: path.resolve(__dirname, '../src/compact/'),
},
{
find: '@table-library/react-table-library/virtualized',
replacement: path.resolve(__dirname, '../src/virtualized/'),
},
{
find: '@table-library/react-table-library/theme',
replacement: path.resolve(__dirname, '../src/theme/'),
},
{
find: '@table-library/react-table-library/resize',
replacement: path.resolve(__dirname, '../src/resize/'),
},
{
find: '@table-library/react-table-library/sort',
replacement: path.resolve(__dirname, '../src/sort/'),
},
{
find: '@table-library/react-table-library/select',
replacement: path.resolve(__dirname, '../src/select/'),
},
{
find: '@table-library/react-table-library/tree',
replacement: path.resolve(__dirname, '../src/tree/'),
},
{
find: '@table-library/react-table-library/pagination',
replacement: path.resolve(__dirname, '../src/pagination/'),
},
{
find: '@table-library/react-table-library/baseline',
replacement: path.resolve(__dirname, '../src/baseline/'),
},
{
find: '@table-library/react-table-library/mantine',
replacement: path.resolve(__dirname, '../src/mantine/'),
},
{
find: '@table-library/react-table-library/chakra-ui',
replacement: path.resolve(__dirname, '../src/chakra-ui/'),
},
{
find: '@table-library/react-table-library/material-ui',
replacement: path.resolve(__dirname, '../src/material-ui/'),
},
{
find: '@emotion/core',
replacement: '@emotion/react',
},
{
find: '@emotion/styled',
replacement: '@emotion/styled',
},
{
find: 'emotion-theming',
replacement: '@emotion/react',
},
],
},
};
},
};