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

Add option to configure compile file's extension #283

Closed
MTrost opened this issue Jan 8, 2023 · 2 comments
Closed

Add option to configure compile file's extension #283

MTrost opened this issue Jan 8, 2023 · 2 comments

Comments

@MTrost
Copy link

MTrost commented Jan 8, 2023

Some JavaScript libraries and tools can't handle .mjs files (e.g. Remix, Photoshop were mentioned in Slack).

It would be great to have a way to tell squint what file extension it uses to create files with non-standard extensions possible (Photoshop uses .psjs).

Files containing #jsx should probably be constrained to .jsx (and .tsx?).

@borkdude
Copy link
Member

borkdude commented Jan 8, 2023

Files containing #jsx are emitted as .jsx already automatically. If not, please provide a repro.
The extension can be configured using the --extension option:

$ npx squint compile --help
Usage: squint compile <files> <opts>

Options:

--elide-imports: do not include imports
--elide-exports: do not include exports
--extension: default extension for JS files

Let me me know if this isn't sufficient

@MTrost
Copy link
Author

MTrost commented Jan 9, 2023

Hi hi 👋

It seems that I missed some iterations, and everything I wished for here is already implemented.

And regarding the #jsx I didn't make myself clear: I meant, that files with #jsx in it should be ignored when changing the file extension and still compile to .jsx files. So exactly as it is already implemented!

Closing this, thanks for your work!

@MTrost MTrost closed this as completed Jan 9, 2023
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

No branches or pull requests

2 participants