Skip to content

Commit 3ca20c7

Browse files
authored
Fixing named prop "_lat" (#238)
* Fixing named prop "_lat" * Adding comment to regex
1 parent c2e1d3d commit 3ca20c7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/firebase/webpack.config.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,21 @@ const baseConfig = {
4040
mangle: {
4141
props: {
4242
ignore_quoted: true,
43-
regex: /^_[^_]|[^_]_$/
43+
/**
44+
* This regex will trigger minification of subproperties that match
45+
* any of the following use cases:
46+
*
47+
* - Prefixed with an underscore (i.e. _)
48+
* - Suffixed with an underscore (i.e. _)
49+
*
50+
* Exceptions:
51+
* - Double underscore prefix/suffix (we have some props that rely on
52+
* this naming convention)
53+
* - `_lat` (we have a property in auth that depends on this name)
54+
*
55+
* This will be kept up to date as this changes
56+
*/
57+
regex: /^_[^_][^lat]|[^_]_$/
4458
}
4559
},
4660
compress: {

0 commit comments

Comments
 (0)