Skip to content

Commit 566b88d

Browse files
committed
save
1 parent 870dd5e commit 566b88d

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

packages-exp/firebase-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"url": "https://github.com/firebase/firebase-js-sdk.git"
119119
},
120120
"scripts": {
121-
"build": "rollup -c && yarn build:compat",
121+
"build": "rollup -c",
122122
"build:release": "rollup -c rollup.config.release.js && yarn build:compat:release",
123123
"build:compat": "rollup -c compat/rollup.config.js",
124124
"build:compat:release": "rollup -c compat/rollup.config.release.js",

packages-exp/firebase-exp/rollup.config.js

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ const typescriptPlugin = rollupTypescriptPlugin({
3232
typescript
3333
});
3434

35+
const typescriptPluginCDN = rollupTypescriptPlugin({
36+
typescript,
37+
tsconfigOverride: {
38+
compilerOptions: {
39+
declaration: false
40+
}
41+
}
42+
});
43+
3544
/**
3645
* Individual Component Builds
3746
*/
@@ -77,4 +86,40 @@ const componentBuilds = pkg.components
7786
})
7887
.reduce((a, b) => a.concat(b), []);
7988

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

Comments
 (0)