Skip to content

Commit 3da5216

Browse files
Review
1 parent 3545adf commit 3da5216

File tree

4 files changed

+13
-21
lines changed

4 files changed

+13
-21
lines changed

packages/firestore/memory/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@firebase/firestore/memory",
33
"description": "A memory-only build of the Cloud Firestore JS SDK.",
44
"main": "../dist/index.memory.node.cjs.js",
5-
"mainES2017": "../dist/index.memory.node.esm2017.js",
5+
"main-esn2017": "../dist/index.memory.node.esm2017.js",
66
"browser": "../dist/index.memory.cjs.js",
77
"module": "../dist/index.memory.esm.js",
88
"esm2017": "../dist/index.memory.esm2017.js",

packages/firestore/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"prepare": "yarn build"
2727
},
2828
"main": "dist/index.node.cjs.js",
29-
"mainES2017": "dist/index.node.esm2017.js",
29+
"main-esm2017": "dist/index.node.esm2017.js",
3030
"browser": "dist/index.cjs.js",
3131
"module": "dist/index.esm.js",
3232
"esm2017": "dist/index.esm2017.js",

packages/firestore/rollup.config.es.js

+5-14
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,15 @@ import pkg from './package.json';
2727
import memoryPkg from './memory/package.json';
2828

2929
// This file defines the second rollup pipeline and transpiles the ES2017 SDK
30-
// into ES3 code. By splitting the build process into two independent build
30+
// into ES5 code. By splitting the build process into two independent build
3131
// pipelines, we take advantage of tree shaking in ES2017 builds even for
3232
// language levels that don't support tree shaking.
3333

3434
const browserPlugins = [
3535
typescriptPlugin({
3636
typescript,
3737
compilerOptions: {
38-
allowJs: true,
39-
importHelpers: true
38+
allowJs: true
4039
},
4140
include: ['dist/*.js']
4241
}),
@@ -54,18 +53,10 @@ const nodePlugins = [
5453
typescriptPlugin({
5554
typescript,
5655
compilerOptions: {
57-
allowJs: true,
58-
importHelpers: true
56+
allowJs: true
5957
},
6058
include: ['dist/*.js']
6159
}),
62-
terser({
63-
output: {
64-
comments: 'all',
65-
beautify: true
66-
},
67-
mangle: false
68-
}),
6960
sourcemaps()
7061
];
7162

@@ -106,13 +97,13 @@ const browserBuilds = [
10697

10798
const nodeBuilds = [
10899
{
109-
input: pkg.mainES2017,
100+
input: pkg.main-enm2017,
110101
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
111102
plugins: nodePlugins,
112103
external: resolveNodeExterns
113104
},
114105
{
115-
input: path.resolve('./memory', memoryPkg.mainES2017),
106+
input: path.resolve('./memory', memoryPkg.main-enm2017),
116107
output: [
117108
{
118109
file: path.resolve('./memory', memoryPkg.main),

packages/firestore/rollup.config.es2017.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ import {
4848
// The in-memory builds are roughly 130 KB smaller, but throw an exception
4949
// for calls to `enablePersistence()` or `clearPersistence()`.
5050
//
51-
// We use two different rollup pipelines to take advantage of tree shaking in
52-
// the ES2017 builds. The build pipeline in this file produces ES2017 builds
53-
// that are consumed by `rollup.config.es.js`.
51+
// We use two different rollup pipelines to take advantage of tree shaking,
52+
// which Rollup only supports in pure ES2017 builds. The build pipeline in this
53+
// file produces pre-tree shaken ES2017 builds that are consumed by the ES5
54+
// builds in `rollup.config.es.js`.
5455
//
5556
// All browser builds rely on Terser's property name mangling to reduce code
5657
// size.
@@ -157,7 +158,7 @@ const nodeBuilds = [
157158
// Persistence build
158159
{
159160
input: 'index.node.ts',
160-
output: [{ file: pkg.mainES2017, format: 'es', sourcemap: true }],
161+
output: [{ file: pkg.main-enm2017, format: 'es', sourcemap: true }],
161162
plugins: nodeBuildPlugins,
162163
external: resolveNodeExterns
163164
},
@@ -166,7 +167,7 @@ const nodeBuilds = [
166167
input: 'index.node.memory.ts',
167168
output: [
168169
{
169-
file: path.resolve('./memory', memoryPkg.mainES2017),
170+
file: path.resolve('./memory', memoryPkg.main-enm2017),
170171
format: 'es',
171172
sourcemap: true
172173
}

0 commit comments

Comments
 (0)