|
| 1 | +const path = require('path'); |
| 2 | + |
1 | 3 | module.exports = {
|
2 | 4 | stories: ['./stories/**/*.@(js|jsx|ts|tsx|mdx)'],
|
3 |
| - addons: ['@storybook/addon-docs', '@storybook/addon-links'], |
| 5 | + addons: ['@storybook/addon-links', '@storybook/addon-essentials'], |
4 | 6 | staticDirs: ['./static'],
|
5 | 7 |
|
6 | 8 | // due to storybook composition, chakra shows up as stories
|
7 | 9 | // https://github.com/chakra-ui/chakra-ui/issues/2263#issuecomment-767557426
|
8 | 10 | refs: {
|
9 | 11 | '@chakra-ui/react': { disable: true },
|
10 | 12 | },
|
| 13 | + framework: '@storybook/react', |
| 14 | + core: { |
| 15 | + builder: '@storybook/builder-vite', |
| 16 | + }, |
11 | 17 |
|
12 |
| - webpackFinal: async (config, { configType }) => { |
| 18 | + async viteFinal(config, { configType }) { |
13 | 19 | // `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
|
14 | 20 | // You can change the configuration based on that.
|
15 | 21 | // 'PRODUCTION' is used when building the static version of storybook.
|
16 | 22 |
|
17 | 23 | // chakra + framer motion is not working with storybook
|
18 | 24 | // https://github.com/framer/motion/issues/1307#issuecomment-966827629
|
19 |
| - config.module.rules.push({ |
20 |
| - type: 'javascript/auto', |
21 |
| - test: /\.mjs$/, |
22 |
| - include: /node_modules/, |
23 |
| - }); |
| 25 | + // config.module.rules.push({ |
| 26 | + // type: 'javascript/auto', |
| 27 | + // test: /\.mjs$/, |
| 28 | + // include: /node_modules/, |
| 29 | + // }); |
24 | 30 |
|
25 | 31 | // chakra does not show styles in storybook
|
26 | 32 | // https://github.com/storybookjs/storybook/issues/13114#issuecomment-846464338
|
27 | 33 | return {
|
28 | 34 | ...config,
|
29 | 35 | resolve: {
|
30 | 36 | ...config.resolve,
|
31 |
| - alias: { |
32 |
| - ...config.resolve.alias, |
33 |
| - '@emotion/core': '@emotion/react', |
34 |
| - '@emotion/styled': '@emotion/styled', |
35 |
| - 'emotion-theming': '@emotion/react', |
36 |
| - }, |
| 37 | + alias: [ |
| 38 | + { |
| 39 | + find: '@table-library/react-table-library/types', |
| 40 | + replacement: path.resolve(__dirname, '../src/types/'), |
| 41 | + }, |
| 42 | + { |
| 43 | + find: '@table-library/react-table-library/common', |
| 44 | + replacement: path.resolve(__dirname, '../src/common/'), |
| 45 | + }, |
| 46 | + { |
| 47 | + find: '@table-library/react-table-library/table', |
| 48 | + replacement: path.resolve(__dirname, '../src/table/'), |
| 49 | + }, |
| 50 | + { |
| 51 | + find: '@table-library/react-table-library/compact', |
| 52 | + replacement: path.resolve(__dirname, '../src/compact/'), |
| 53 | + }, |
| 54 | + { |
| 55 | + find: '@table-library/react-table-library/virtualized', |
| 56 | + replacement: path.resolve(__dirname, '../src/virtualized/'), |
| 57 | + }, |
| 58 | + { |
| 59 | + find: '@table-library/react-table-library/theme', |
| 60 | + replacement: path.resolve(__dirname, '../src/theme/'), |
| 61 | + }, |
| 62 | + { |
| 63 | + find: '@table-library/react-table-library/resize', |
| 64 | + replacement: path.resolve(__dirname, '../src/resize/'), |
| 65 | + }, |
| 66 | + { |
| 67 | + find: '@table-library/react-table-library/sort', |
| 68 | + replacement: path.resolve(__dirname, '../src/sort/'), |
| 69 | + }, |
| 70 | + { |
| 71 | + find: '@table-library/react-table-library/select', |
| 72 | + replacement: path.resolve(__dirname, '../src/select/'), |
| 73 | + }, |
| 74 | + { |
| 75 | + find: '@table-library/react-table-library/tree', |
| 76 | + replacement: path.resolve(__dirname, '../src/tree/'), |
| 77 | + }, |
| 78 | + { |
| 79 | + find: '@table-library/react-table-library/pagination', |
| 80 | + replacement: path.resolve(__dirname, '../src/pagination/'), |
| 81 | + }, |
| 82 | + { |
| 83 | + find: '@table-library/react-table-library/baseline', |
| 84 | + replacement: path.resolve(__dirname, '../src/baseline/'), |
| 85 | + }, |
| 86 | + { |
| 87 | + find: '@table-library/react-table-library/mantine', |
| 88 | + replacement: path.resolve(__dirname, '../src/mantine/'), |
| 89 | + }, |
| 90 | + { |
| 91 | + find: '@table-library/react-table-library/chakra-ui', |
| 92 | + replacement: path.resolve(__dirname, '../src/chakra-ui/'), |
| 93 | + }, |
| 94 | + { |
| 95 | + find: '@table-library/react-table-library/material-ui', |
| 96 | + replacement: path.resolve(__dirname, '../src/material-ui/'), |
| 97 | + }, |
| 98 | + { |
| 99 | + find: '@emotion/core', |
| 100 | + replacement: '@emotion/react', |
| 101 | + }, |
| 102 | + { |
| 103 | + find: '@emotion/styled', |
| 104 | + replacement: '@emotion/styled', |
| 105 | + }, |
| 106 | + { |
| 107 | + find: 'emotion-theming', |
| 108 | + replacement: '@emotion/react', |
| 109 | + }, |
| 110 | + ], |
37 | 111 | },
|
38 | 112 | };
|
39 | 113 | },
|
|
0 commit comments