Skip to content

Fix rollup config for compatibility layer builds #5664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/selfish-tools-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"firebase": patch
---

Fix compatability layer errors that were being thrown in Safari
12 changes: 8 additions & 4 deletions packages/firebase/compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import compatPkg from './package.json';
import appPkg from './app/package.json';

const external = Object.keys(pkg.dependencies || {});
const uglifyOptions = {
mangle: true,
webkit: true, // Necessary to avoid https://bugs.webkit.org/show_bug.cgi?id=223533
}

/**
* Global UMD Build
Expand Down Expand Up @@ -123,7 +127,7 @@ const appBuilds = [
format: 'umd',
name: GLOBAL_NAME
},
plugins: [...plugins, typescriptPluginCDN, uglify()]
plugins: [...plugins, typescriptPluginCDN, uglify(uglifyOptions)]
}
];

Expand Down Expand Up @@ -163,7 +167,7 @@ const componentBuilds = compatPkg.components
{
input: `${__dirname}/${component}/index.ts`,
output: createUmdOutputConfig(`firebase-${component}-compat.js`),
plugins: [...plugins, typescriptPluginCDN, uglify()],
plugins: [...plugins, typescriptPluginCDN, uglify(uglifyOptions)],
external: ['@firebase/app-compat', '@firebase/app']
}
];
Expand Down Expand Up @@ -197,7 +201,7 @@ const completeBuilds = [
sourcemap: true,
name: GLOBAL_NAME
},
plugins: [...plugins, typescriptPluginCDN, uglify()]
plugins: [...plugins, typescriptPluginCDN, uglify(uglifyOptions)]
},
/**
* App Node.js Builds
Expand Down Expand Up @@ -244,7 +248,7 @@ const completeBuilds = [
typescriptPluginCDN,
json(),
commonjs(),
uglify()
uglify(uglifyOptions)
]
},
/**
Expand Down