bigbuffet-rw/packages/pl-hooks/vite.config.ts
marcin mikołajczak 8a047d7c3a work on turning pl-hooks into a separate library
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-13 00:15:58 +02:00

25 lines
627 B
TypeScript

import { fileURLToPath, URL } from 'node:url';
import { resolve } from 'path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
export default defineConfig({
plugins: [dts({ include: ['lib'], insertTypesEntry: true })],
build: {
copyPublicDir: false,
lib: {
entry: resolve(__dirname, 'lib/main.ts'),
fileName: (format) => `main.${format}.js`,
formats: ['es'],
name: 'pl-hooks',
},
target: 'esnext',
sourcemap: true,
},
resolve: {
alias: [
{ find: 'pl-hooks', replacement: fileURLToPath(new URL('./lib', import.meta.url)) },
],
},
});