Skip to content

Commit c5f3b27

Browse files
Parallelized builds (#3629)
1 parent 6a95ae1 commit c5f3b27

12 files changed

+385
-307
lines changed

packages/firestore/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"description": "The Cloud Firestore component of the Firebase JS SDK.",
88
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
99
"scripts": {
10-
"build": "rollup -c rollup.config.es2017.js && rollup -c rollup.config.es5.js && yarn build:lite && yarn build:exp",
10+
"bundle": "rollup -c",
11+
"build": "run-p 'bundle rollup.config.browser.js' 'bundle rollup.config.browser.memory.js' 'bundle rollup.config.node.js' 'bundle rollup.config.node.memory.js' 'bundle rollup.config.rn.js' 'bundle rollup.config.rn.memory.js' build:lite build:exp",
1112
"build:scripts": "tsc -moduleResolution node --module commonjs scripts/*.ts && ls scripts/*.js | xargs -I % sh -c 'terser % -o %'",
1213
"build:release": "rollup -c rollup.config.es2017.js && rollup -c rollup.config.es5.js",
1314
"build:deps": "lerna run --scope @firebase/'{app,firestore}' --include-dependencies build",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import pkg from './package.json';
19+
20+
const util = require('./rollup.shared');
21+
22+
export default [
23+
{
24+
input: 'index.ts',
25+
output: {
26+
file: pkg.esm2017,
27+
format: 'es',
28+
sourcemap: true
29+
},
30+
plugins: util.es2017Plugins('browser', /* mangled= */ true),
31+
external: util.resolveBrowserExterns
32+
},
33+
{
34+
input: pkg.esm2017,
35+
output: { file: pkg.module, format: 'es', sourcemap: true },
36+
plugins: util.es2017ToEs5Plugins(/* mangled= */ true),
37+
external: util.resolveBrowserExterns
38+
},
39+
{
40+
input: pkg.esm2017,
41+
output: { file: pkg.browser, format: 'cjs', sourcemap: true },
42+
plugins: util.es2017ToEs5Plugins(/* mangled= */ true),
43+
external: util.resolveBrowserExterns
44+
}
45+
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import * as path from 'path';
19+
import memoryPkg from './memory/package.json';
20+
21+
const util = require('./rollup.shared');
22+
23+
export default [
24+
{
25+
input: 'index.memory.ts',
26+
output: {
27+
file: path.resolve('./memory', memoryPkg['esm2017']),
28+
format: 'es',
29+
sourcemap: true
30+
},
31+
plugins: util.es2017Plugins('browser', /* mangled= */ true),
32+
external: util.resolveBrowserExterns
33+
},
34+
{
35+
input: path.resolve('./memory', memoryPkg['esm2017']),
36+
output: {
37+
file: path.resolve('./memory', memoryPkg.module),
38+
format: 'es',
39+
sourcemap: true
40+
},
41+
plugins: util.es2017ToEs5Plugins(/* mangled= */ true),
42+
external: util.resolveBrowserExterns
43+
},
44+
{
45+
input: path.resolve('./memory', memoryPkg['esm2017']),
46+
output: {
47+
file: path.resolve('./memory', memoryPkg.browser),
48+
format: 'cjs',
49+
sourcemap: true
50+
},
51+
plugins: util.es2017ToEs5Plugins(/* mangled= */ true),
52+
external: util.resolveBrowserExterns
53+
}
54+
];

packages/firestore/rollup.config.es2017.js

-177
This file was deleted.

0 commit comments

Comments
 (0)