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

Conflicting files #32

Open
andrzej-woof opened this issue Mar 6, 2023 · 3 comments
Open

Conflicting files #32

andrzej-woof opened this issue Mar 6, 2023 · 3 comments

Comments

@andrzej-woof
Copy link

I'm using ts-import to load files from a directory. Seems that if there are two files that result in same compiled file name they are conflicting with each other for example loading /path/file.ts and /path/file.js results in compiled .cache/ts-import/file.js for both of them and load result is not the expected one

@radarsu
Copy link
Owner

radarsu commented Apr 11, 2023

Hey, could you elaborate a bit on that? How do you achieve 2 different files being compiled to the same output directory? ts-import has mechanisms to avoid that by keeping all compiled files in the same directory as they were on host machine. So file ./path/file1.ts will be compiled to ./.cache/path/file1.js and ./path/file2.ts will be compiled to ./path/file2.ts.

I can imagine one could compile file ./path/file.ts and then replace exact same path with next file to compile - is that your case?

@andrzej-woof
Copy link
Author

Hey @radarsu
It's about having same file name with different extension. Like ./path/file1.ts and ./path/file1.js in my case, as far as I remember they will both will get same extension in cache and hence cause a conflict (one will be overriden by another)

@radarsu
Copy link
Owner

radarsu commented Apr 11, 2023

I think that's a valid case. I can add support for multiple same-named files with different extensions, but that will only apply to ESM versions >5. Let me know if you need support for that in version 4.

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