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

bug: tsx is inadvertently adding support for loading .txt file #256

Closed
privatenumber opened this issue Jun 13, 2023 · 3 comments
Closed
Labels
bug Something isn't working outdated

Comments

@privatenumber
Copy link
Owner

Discussed in https://github.com/esbuild-kit/tsx/discussions/255

Originally posted by phbernard June 13, 2023
tsx handles text file import out of the box:

import myTextFile from 'myTextFile.txt'

Is it possible to do the same with binary files? For example:

import myBinaryFile from 'myBinaryFile.bin' // DOESN'T WORK

A command line option? Using a particular extension maybe?

@privatenumber privatenumber added the bug Something isn't working label Jun 13, 2023
@rentalhost
Copy link

I believe that it is supposed to be supported according to the documentation at https://esbuild.github.io/content-types/#text (if I am not mistaken).

Additionally, binary content could also be supported as mentioned in the documentation at https://esbuild.github.io/content-types/#binary.

@privatenumber
Copy link
Owner Author

Neither. tsx's goal is TypeScript parity, not esbuild parity.

@privatenumber
Copy link
Owner Author

Fixed via esbuild-kit/cjs-loader#40

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working outdated
Projects
None yet
Development

No branches or pull requests

2 participants