bigbuffet-rw/packages/pl-hooks/vite.config.ts
marcin mikołajczak 2fb53d92be pl-hooks: more prefetching
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-21 12:07:19 +02:00

30 lines
737 B
TypeScript

import { fileURLToPath, URL } from 'node:url';
import { resolve } from 'path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import pkg from './package.json';
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,
rollupOptions: {
external: Object.keys(pkg.dependencies),
},
},
resolve: {
alias: [
{ find: 'pl-hooks', replacement: fileURLToPath(new URL('./lib', import.meta.url)) },
],
},
});