- Created TypeScript configuration files for library and React applications. - Added ESLint configurations for library, React, and Storybook. - Implemented a basic Button component in the UI package. - Set up Vite for the docs development environment.
39 lines
841 B
JavaScript
39 lines
841 B
JavaScript
import { dirname, join, resolve } from 'path';
|
|
|
|
function getAbsolutePath(value) {
|
|
return dirname(require.resolve(join(value, 'package.json')));
|
|
}
|
|
|
|
const config = {
|
|
stories: ['../stories/*.stories.tsx', '../stories/**/*.stories.tsx'],
|
|
addons: [getAbsolutePath('@storybook/addon-links'), getAbsolutePath('@storybook/addon-essentials')],
|
|
framework: {
|
|
name: getAbsolutePath('@storybook/react-vite'),
|
|
options: {},
|
|
},
|
|
|
|
core: {},
|
|
|
|
async viteFinal(config, { configType }) {
|
|
// customize the Vite config here
|
|
return {
|
|
...config,
|
|
define: { 'process.env': {} },
|
|
resolve: {
|
|
alias: [
|
|
{
|
|
find: 'ui',
|
|
replacement: resolve(__dirname, '../../../packages/ui/'),
|
|
},
|
|
],
|
|
},
|
|
};
|
|
},
|
|
|
|
docs: {
|
|
autodocs: true,
|
|
},
|
|
};
|
|
|
|
export default config;
|