utils/vite.config.ts

21 lines
455 B
TypeScript
Raw Normal View History

2024-04-11 23:19:36 -04:00
import {resolve} from 'path';
import {defineConfig} from 'vite';
2024-02-07 01:33:07 -05:00
import dts from 'vite-plugin-dts';
export default defineConfig({
build: {
lib: {
entry: resolve(process.cwd(), 'src/index.ts'),
2024-04-11 23:19:36 -04:00
name: 'utils',
2024-02-07 01:33:07 -05:00
fileName: (module, entryName) => {
2024-04-11 23:19:36 -04:00
if(module == 'es') return 'utils.mjs';
if(module == 'umd') return 'utils.cjs';
2024-02-07 01:33:07 -05:00
}
},
2024-04-11 23:19:36 -04:00
emptyOutDir: true,
minify: true,
sourcemap: true
2024-02-07 01:33:07 -05:00
},
plugins: [dts()],
});