bigbuffet-rw/packages/pl-api/vite.config.ts
marcin mikołajczak 595c16ace2 externalize pl-api deps
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-16 18:46:14 +02:00

24 lines
559 B
TypeScript

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-api',
},
target: 'esnext',
sourcemap: true,
rollupOptions: {
external: Object.keys(pkg.dependencies),
},
},
});