Skip to content

Commit e641edd

Browse files
authored
Create package.json field for components (#1716)
Centralized list of components to publish.
1 parent b35ae72 commit e641edd

File tree

2 files changed

+11
-27
lines changed

2 files changed

+11
-27
lines changed

packages/firebase/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,13 @@
5656
"rollup-plugin-uglify": "6.0.2",
5757
"typescript": "3.4.3"
5858
},
59-
"typings": "index.d.ts"
59+
"typings": "index.d.ts",
60+
"components": [
61+
"auth",
62+
"database",
63+
"firestore",
64+
"functions",
65+
"messaging",
66+
"storage"
67+
]
6068
}

packages/firebase/rollup.config.js

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@ import { uglify } from 'rollup-plugin-uglify';
2424
import pkg from './package.json';
2525

2626
import appPkg from './app/package.json';
27-
import authPkg from './auth/package.json';
28-
import databasePkg from './database/package.json';
29-
import firestorePkg from './firestore/package.json';
30-
import functionsPkg from './functions/package.json';
31-
import messagingPkg from './messaging/package.json';
32-
import storagePkg from './storage/package.json';
33-
34-
const pkgsByName = {
35-
app: appPkg,
36-
auth: authPkg,
37-
database: databasePkg,
38-
firestore: firestorePkg,
39-
functions: functionsPkg,
40-
messaging: messagingPkg,
41-
storage: storagePkg
42-
};
4327

4428
const plugins = [
4529
sourcemaps(),
@@ -88,17 +72,9 @@ const appBuilds = [
8872
}
8973
];
9074

91-
const components = [
92-
'auth',
93-
'database',
94-
'firestore',
95-
'functions',
96-
'messaging',
97-
'storage'
98-
];
99-
const componentBuilds = components
75+
const componentBuilds = pkg.components
10076
.map(component => {
101-
const pkg = pkgsByName[component];
77+
const pkg = require(`./${component}/package.json`);
10278
return [
10379
{
10480
input: `${component}/index.ts`,

0 commit comments

Comments
 (0)