Build tools for Naive Potato UI
generate common vite config by
generateViteConfig
function, which will be used by all child packages;
- @vitejs/plugin-vue: for vue single file component;
- run
pnpm --filter ./packages/** build
to build all packages,which mean runvite build
in each package, generatedist
folder which contains 'es' and 'umd' production code and style file;
- using
vue-tsc
to generate dts file for every vue component and ts file in packages, but those dts file generated in root folder, so we need to move them to each individual package folder's dist folder(need to clean up root dist dir first); - move all dts file to each individual package folder's dist folder by vite plugin hook, and cause vite build didn't care about child package's
types
dir(if it has), so we need to move types dir to each individual package folder's dist folder too;
- now every package has its own dist folder which contains 'es' and 'umd' production code and style file and dts file;
- generate new package.json content and replace the old one;
- name:
@naive-potato-ui
prefix, get package name by folder name, generate kebab-case
- name: