Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
}
},
"typings": "dist/index.d.ts",
"sideEffects": false,
"files": [
"dist",
"src"
Expand Down Expand Up @@ -108,7 +109,7 @@
},
"dependencies": {
"rxfire": "^6.1.0",
"rxjs": "^6.6.3 || ^7.0.1",
"rxjs": "^7.1.0",
"use-sync-external-store": "^1.2.0"
},
"allowScripts": {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": ["src", "types"],
"compilerOptions": {
"target": "es2015",
"target": "es2024",
"module": "esnext",
"lib": ["dom", "esnext"],
"types": ["vitest/globals"],
Expand Down
29 changes: 26 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ const externals = [
// loads client-side in a Next.js App Router (strict ESM) context. Externalizing keeps
// the shim's React 16/17 fallback intact while removing the require from our dist.
'use-sync-external-store/shim',
// Declared dependencies: let the consumer's bundler resolve (and dedupe/tree-shake) them instead of inlining a copy.
'rxjs',
'rxjs/operators',
'rxfire/auth',
'rxfire/database',
'rxfire/firestore',
'rxfire/functions',
'rxfire/performance',
'rxfire/remote-config',
'rxfire/storage',
'firebase',
'firebase/app',
'firebase/firestore',
Expand Down Expand Up @@ -67,9 +77,22 @@ export default defineConfig({
},
rollupOptions: {
external: externals,
output: {
globals: { react: 'React' },
},
output: [
// Emit one ES module per source file so `"sideEffects": false` lets bundlers drop unused products
// (and their `firebase/*` imports) instead of pulling every Firebase SDK in through a single index.js.
{
format: 'es',
preserveModules: true,
preserveModulesRoot: 'src',
entryFileNames: '[name].js',
},
{
format: 'umd',
name: 'ReactFire',
entryFileNames: 'index.umd.cjs',
globals: { react: 'React' },
},
],
},
sourcemap: true,
},
Expand Down
Loading