mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-07-06 04:52:31 +00:00
Temporary workaround for Babel issue affecting web-app tests
The Babel plugin `@babel/plugin-transform-regenerator` used in the web-app Jest tests (as part of @babel/preset-env) introduces a bug when transforming this specific minified lightweight built. The issue is that the mangled `ArrayStream` class name (`n` in the specific case) gets wrongly reused and shadowed by a local variable in the `readPacket` function. As a workaround for the problem, and to not have to amend the babel config for each monorepo workspace, we disable mangling the specific class name.
This commit is contained in:
parent
299342946d
commit
61c744e769
@ -51,6 +51,15 @@ const terserOptions = {
|
|||||||
compress: {
|
compress: {
|
||||||
unsafe: true
|
unsafe: true
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* The Babel plugin `@babel/plugin-transform-regenerator` used in the web-app Jest tests
|
||||||
|
* (as part of @babel/preset-env) introduces a bug when transforming the minified lightweight built.
|
||||||
|
* The issue is that the mangled `ArrayStream` class name (`n` in the specific case) gets wrongly
|
||||||
|
* reused and shadowed by a local variable in the `readPacket` function (see https://github.com/babel/babel/issues/16334).
|
||||||
|
* As a workaround for the problem, and to not have to amend the babel config for each monorepo workspace, we disable mangling
|
||||||
|
* the specific class name.
|
||||||
|
*/
|
||||||
|
mangle: { reserved: ['ArrayStream'] },
|
||||||
output: {
|
output: {
|
||||||
comments: '/^(?:!|#__)/',
|
comments: '/^(?:!|#__)/',
|
||||||
preserve_annotations: true
|
preserve_annotations: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user