Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

build(y-indexeddb): fix output package.json (#4640)

Alex Yang1d06114f0053
diff --git a/packages/y-indexeddb/package.json b/packages/y-indexeddb/package.json
index add71feeb6..15a27221e0 100644
--- a/packages/y-indexeddb/package.json
+++ b/packages/y-indexeddb/package.json
@@ -22,14 +22,12 @@
},
"publishConfig": {
"access": "public",
- "main": "dist/index.umd.cjs",
- "module": "dist/index.js",
- "types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
- "require": "./dist/index.umd.cjs"
+ "require": "./dist/index.cjs",
+ "default": "./dist/index.umd.cjs"
}
}
},
diff --git a/packages/y-indexeddb/vite.config.ts b/packages/y-indexeddb/vite.config.ts
index e38ab9b59e..6195b4230c 100644
--- a/packages/y-indexeddb/vite.config.ts
+++ b/packages/y-indexeddb/vite.config.ts
@@ -8,16 +8,21 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url));
export default defineConfig({
build: {
- terserOptions: {
- ecma: 2020,
- },
+ 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',
+ },
+ },
external: ['idb', 'yjs'],
},
},