Skip to content

Fix TypeScript asset MIME type - #46

Merged
smnandre merged 1 commit into
playwright-php:mainfrom
smnandre:sa/typescript-assets
Aug 16, 2026
Merged

Fix TypeScript asset MIME type#46
smnandre merged 1 commit into
playwright-php:mainfrom
smnandre:sa/typescript-assets

Conversation

@smnandre

Copy link
Copy Markdown
Member

This pull request updates how TypeScript asset files are handled by the asset mapper, ensuring they are served with the correct MIME type.

TypeScript asset handling:

  • Updated resolveMimeType in AssetMapperProxy.php to explicitly return 'text/javascript' for TypeScript-related extensions (ts, mts, cts, tsx) before any other MIME type logic is applied.
  • Removed redundant strtolower call in the fallback MIME type logic, since extension normalization now happens earlier.

Fixes #44

@smnandre
smnandre merged commit f3fb425 into playwright-php:main Aug 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript assets are served as application/typescript, so browsers refuse them as ES modules

1 participant