2023-04-02 10:57:50 +03:00
|
|
|
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: {
|
2023-10-17 00:25:09 +03:00
|
|
|
minify: 'esbuild',
|
2023-04-02 10:57:50 +03:00
|
|
|
sourcemap: true,
|
|
|
|
lib: {
|
|
|
|
entry: resolve(__dirname, 'src/index.ts'),
|
|
|
|
fileName: 'index',
|
2023-04-21 02:08:33 +03:00
|
|
|
name: 'ToEverythingIndexedDBProvider',
|
2023-10-17 00:25:09 +03:00
|
|
|
formats: ['es', 'cjs', 'umd'],
|
2023-04-02 10:57:50 +03:00
|
|
|
},
|
|
|
|
rollupOptions: {
|
2023-10-17 00:25:09 +03:00
|
|
|
output: {
|
|
|
|
globals: {
|
|
|
|
idb: 'idb',
|
|
|
|
yjs: 'yjs',
|
2023-10-17 03:47:05 +03:00
|
|
|
'y-provider': 'yProvider',
|
2023-10-17 00:25:09 +03:00
|
|
|
},
|
|
|
|
},
|
2023-10-17 03:47:05 +03:00
|
|
|
external: ['idb', 'yjs', 'y-provider'],
|
2023-04-02 10:57:50 +03:00
|
|
|
},
|
|
|
|
},
|
2023-07-30 16:19:59 +03:00
|
|
|
plugins: [
|
|
|
|
dts({
|
|
|
|
entryRoot: resolve(__dirname, 'src'),
|
|
|
|
}),
|
|
|
|
],
|
2023-04-02 10:57:50 +03:00
|
|
|
});
|