Skip to content
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

Fix: Workaround for transpilation failure with create-react-app #9093

Merged
merged 2 commits into from Jan 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 11 additions & 6 deletions packages/core/src/textures/resources/ImageBitmapResource.ts
Expand Up @@ -59,18 +59,23 @@ export class ImageBitmapResource extends BaseImageResource
{
options = options || {};

let baseSource;
let url;

if (typeof source === 'string')
{
super(ImageBitmapResource.EMPTY);

this.url = source;
baseSource = ImageBitmapResource.EMPTY;
url = source;
}
else
{
super(source);

this.url = null;
baseSource = source;
url = null;
}
// Using super() in if() can cause transpilation problems in some cases, so take it out of if().
// See https://github.com/pixijs/pixijs/pull/9093 for details.
super(baseSource);
this.url = url;

this.crossOrigin = options.crossOrigin ?? true;
this.alphaMode = typeof options.alphaMode === 'number' ? options.alphaMode : null;
Expand Down