Custom Vite.js configuration for TypeScript libraries.
- Install the package and its required peer dependencies:
pnpm add -D @jpapini/vite-config vite
- Create a
vite.config.js
file with the following content:
import url from 'node:url';
import { createLibraryViteConfig } from '@jpapini/vite-config';
export default createLibraryViteConfig({
rootDir: url.fileURLToPath(new URL('.', import.meta.url)),
});
- Edit the
package.json
file to add the following scripts:
{
"scripts": {
"build": "vite build"
}
}
- Julien Papini julien.papini@gmail.com