@@ -32,6 +32,15 @@ const typescriptPlugin = rollupTypescriptPlugin({
32
32
typescript
33
33
} ) ;
34
34
35
+ const typescriptPluginCDN = rollupTypescriptPlugin ( {
36
+ typescript,
37
+ tsconfigOverride : {
38
+ compilerOptions : {
39
+ declaration : false
40
+ }
41
+ }
42
+ } ) ;
43
+
35
44
/**
36
45
* Individual Component Builds
37
46
*/
@@ -77,4 +86,40 @@ const componentBuilds = pkg.components
77
86
} )
78
87
. reduce ( ( a , b ) => a . concat ( b ) , [ ] ) ;
79
88
80
- export default [ ...appBuilds , ...componentBuilds ] ;
89
+ /**
90
+ * CDN script builds
91
+ */
92
+
93
+ const cdnBuilds = [
94
+ {
95
+ input : 'app/index.cdn.ts' ,
96
+ output : {
97
+ file : 'firebase-app.js' ,
98
+ sourcemap : true ,
99
+ format : 'es'
100
+ } ,
101
+ plugins : [ ...plugins , typescriptPluginCDN ]
102
+ } ,
103
+ ...pkg . components
104
+ . filter ( component => component !== 'app' )
105
+ . map ( component => {
106
+ const pkg = require ( `./${ component } /package.json` ) ;
107
+ // It is needed for handling sub modules, for example firestore/lite which should produce firebase-firestore-lite.js
108
+ // Otherwise, we will create a directory with '/' in the name.
109
+ const componentName = component . replace ( '/' , '-' ) ;
110
+
111
+ return {
112
+ input : `${ component } /index.ts` ,
113
+ output : {
114
+ file : `firebase-${ componentName } .js` ,
115
+ sourcemap : true ,
116
+ format : 'es'
117
+ } ,
118
+ plugins : [ ...plugins , typescriptPluginCDN ] ,
119
+ external : [ '@firebase/app-exp' , '@firebase/util' ]
120
+ } ;
121
+ } )
122
+ ] ;
123
+
124
+ // export default [...appBuilds, ...componentBuilds, ...cdnBuilds];
125
+ export default [ ...cdnBuilds ] ;
0 commit comments