-
-
Notifications
You must be signed in to change notification settings - Fork 28
v1.1.2 no longer transforming paths #13
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
Comments
Since 1.1.1 this module does not interrupt typescript's logic of module importing. So if you do not use FooViewModel, or if FooViewModel is type and you are waiting for import side effects on runtime, it will not work. Try to compile your code with original compiler and see if 'me/viewModels/fooViewModel' import is included. If it does, please provide some more info about your modules. |
For side effect imports usually used: import "something"; |
@sbmw So, was this the case when you wanted "import side effects" or is this a bug? |
@anion155 Thanks for the help, but no I'm not using side effect imports and I believe this is a bug. I've put together a very basic demo to show this in action: https://github.com/sbmw/transformdemo One thing I have discovered: I had "module": "esnext" in my tsconfig. With that set, paths are not transformed in the output .js or .d.ts. If that is changed to "module": "commonjs" the .js file has its path correctly transformed. However, the paths in output .d.ts declaration files are not transformed. If you were to consume the demo repo above as a package in another project you would get a compilation error like import { ApiResponseViewModel } from "me/viewModels/apiResponseViewModel". https://github.com/sbmw/transformdemo/blob/master/dist/ajax/fetchHandler.d.ts for reference. |
About .d.ts read this #4 |
Thanks. Re .d.ts, yes I know that and if you see my tsconfig you'll see I have danielpza's solution in place: https://github.com/sbmw/transformdemo/blob/master/tsconfig.json
But it is no longer working. |
Ok, will look into this. |
@danielpza git does not delete anything before |
@sbmw the fix is up in v1.1.3, I tested it in your demo https://github.com/sbmw/transformdemo and it worked. |
Hi, thanks for this excellent plugin.
Unfortunately something seems to have stopped working (for me at least) in v1.1.2.
I've played around with incremental updates and believe the issue is in 73dd832 / "fix: type only import not deleted from result file"
Specifically this change:
My paths are set as follows:
An import looks like:
For now I can just use 1.1.0. Please let me know if there's any further info I can provide.
The text was updated successfully, but these errors were encountered: