mirror of
https://github.com/morten-olsen/bob-the-algorithm.git
synced 2026-02-08 00:46:25 +01:00
29 lines
676 B
JavaScript
29 lines
676 B
JavaScript
/* eslint-disable no-undef */
|
|
import { defineConfig } from 'vite';
|
|
import { peerDependencies, dependencies } from './package.json';
|
|
import path from 'path';
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
build: {
|
|
lib: {
|
|
entry: path.resolve(__dirname, 'src', 'index.ts'),
|
|
formats: ['es', 'cjs'],
|
|
fileName: (ext) => `index.${ext}.js`,
|
|
// for UMD name: 'GlobalName'
|
|
},
|
|
outDir: './public',
|
|
rollupOptions: {
|
|
external: [...Object.keys(peerDependencies), ...Object.keys(dependencies)],
|
|
},
|
|
target: 'esnext',
|
|
sourcemap: true,
|
|
emptyOutDir: false,
|
|
},
|
|
});
|
|
|