I want to create a monorepo which will include some packages and will have the following folder structure:
packages
|
|___ core
|
|__button
| |_Button.css
| |_Button.tsx
| |_index.ts // export * from "./Button"
|__dialog
| |_Dialog.css
| |_Dialog.tsx
| |_index.ts // export * from "./Dialog"
|__index.ts //export * from "./button"; export * from "./dialog";
What I want to achieve with vite build
is the following structure under node_modules
:
my_package_name
|
|___ core
|_dist-es
| |
| |__button
| | |_Button.css.js
| | |_Button.js
| |__dialog
| | |_Dialog.css.js
| | |_Dialog.js
| |__index.js // export {Button} from './button/Button.js'; export {Dialog} from './dialog/Dialog.js';
|
|_dist-types
| |
| |__button
| | |_Button.d.ts
| | |_index.d.ts
| |__dialog
| | |_Dialog.d.ts
| | |_index.d.ts
| |__index.d.ts //export * from "./button"; export * from "./dialog";
What is the configuration of vite.config.ts
in order to achieve that?