mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-15 00:33:06 +03:00
36 lines
771 B
TypeScript
36 lines
771 B
TypeScript
import { resolve } from 'node:path';
|
|
|
|
import { fileURLToPath } from 'url';
|
|
import { defineConfig } from 'vite';
|
|
import dts from 'vite-plugin-dts';
|
|
|
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
|
|
export default defineConfig({
|
|
build: {
|
|
minify: 'esbuild',
|
|
sourcemap: true,
|
|
lib: {
|
|
entry: resolve(__dirname, 'src/index.ts'),
|
|
fileName: 'index',
|
|
name: 'ToEverythingIndexedDBProvider',
|
|
formats: ['es', 'cjs', 'umd'],
|
|
},
|
|
rollupOptions: {
|
|
output: {
|
|
globals: {
|
|
idb: 'idb',
|
|
yjs: 'yjs',
|
|
'y-provider': 'yProvider',
|
|
},
|
|
},
|
|
external: ['idb', 'yjs', 'y-provider'],
|
|
},
|
|
},
|
|
plugins: [
|
|
dts({
|
|
entryRoot: resolve(__dirname, 'src'),
|
|
}),
|
|
],
|
|
});
|