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

SinglePageApp should support .wasm files #331

Closed
AtteR opened this issue May 3, 2023 · 1 comment
Closed

SinglePageApp should support .wasm files #331

AtteR opened this issue May 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@AtteR
Copy link
Contributor

AtteR commented May 3, 2023

Start from the Use-case

Hello,

Currently CloudFront request function redirects .wasm files to /index.html (https://github.com/getlift/lift/blob/master/src/constructs/aws/SinglePageApp.ts#L48)

This makes the .wasm files load as HTML, which means that .wasm file is not loaded properly.

Adding wasm to REDIRECT_INDEX seems to fix this problem.

Example Config

No response

Implementation Idea

Add wasm to REDIRECT_REGEX:

var REDIRECT_REGEX = /^[^.]+$|.(?!(css|gif|ico|jpg|jpeg|js|png|txt|svg|woff|woff2|ttf|map|json|webp|xml|pdf|webmanifest|avif|wasm)$)([^.]+$)/;

This seems to fix the issue.

@AtteR AtteR added the enhancement New feature or request label May 3, 2023
@mnapoli
Copy link
Member

mnapoli commented May 3, 2023

Hi, thanks for the report, feel free to send a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants