Skip to content

Commit be794bf

Browse files
Merge a4781c8 into 74b06f5
2 parents 74b06f5 + a4781c8 commit be794bf

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

packages/firestore/rollup.config.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2018 Google Inc.
3+
* Copyright 2018 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -105,6 +105,13 @@ const es5BuildPlugins = [
105105
transformers: appendPrivatePrefixTransformers,
106106
cacheRoot: `./.cache/es5.mangled/`
107107
}),
108+
{
109+
transform(code) {
110+
// Allow Rollup to drop unused classes.
111+
// See https://github.com/rollup/rollup/issues/2807
112+
return code.replace(/\/\*\* @class \*\//g, "\/*@__PURE__*\/");
113+
}
114+
},
108115
json(),
109116
terser(manglePrivatePropertiesOptions)
110117
];
@@ -152,7 +159,7 @@ const browserBuilds = [
152159
format: 'es',
153160
sourcemap: true
154161
},
155-
plugins: es5BuildPlugins,
162+
plugins: es2017BuildPlugins,
156163
external: resolveBrowserExterns
157164
},
158165
// ES2017 ESM build (memory-only)
@@ -198,6 +205,13 @@ const nodeBuildPlugins = [
198205
typescript,
199206
cacheRoot: `./.cache/node/`
200207
}),
208+
{
209+
transform(code) {
210+
// Allow Rollup to drop unused classes.
211+
// See https://github.com/rollup/rollup/issues/2807
212+
return code.replace(/\/\*\* @class \*\//g, "\/*@__PURE__*\/");
213+
}
214+
},
201215
json(),
202216
// Needed as we also use the *.proto files
203217
copy({

0 commit comments

Comments
 (0)