-
-
Notifications
You must be signed in to change notification settings - Fork 28
outDir is not taking into account #103
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
Perhaps the virtual directories would help in this case |
Thanks for your prompt answer
but same result. Is my assumptions good ?, I mean, looking at outDir + df-core path, it sounds logic to have Typescript compiles with such configuration and it works with tcspaths (no offense ;-)) but I much prefer your plugin. |
Looking at your code and debugging the plugin, I found a way to deal with rootDirs.
I'm wondering if we could have another way just using 'paths', 'rootDir' and 'outDir' to achieve the same. I have the feeling to duplicate the information. Feel free to close this issue and thanks for your help and for this plugin. |
Glad you find your solution. I'll keep the issue open in case someone wants to chime in. |
@emmkimme I'd like to have a look into this. Would you mind making a reproduction repo / branch for me to try it? I'm not entirely sure I see what's happening here, but it looks like an issue of tsconfig being in a totally separate location from the source files. You might be right that this shouldn't be the standard behaviour. I'd need an example to see what's going on, though. |
I have same problem, I think the reason is transform plugin resolve relative path form source file rather than this output file, but sometimes we will emit files into the different level dir, that's why the final relative path is wrong. I see this issue has tagged |
I'm having a similar issue, here's my {
"compilerOptions": {
"target": "es5",
"module": "esnext",
"moduleResolution": "node",
"declaration": true,
"outDir": "dist",
"strict": true,
"lib": ["es5", "ES2015.Promise", "DOM"],
"stripInternal": true,
"sourceMap": true,
"strictNullChecks": true,
"esModuleInterop": true,
"noEmitHelpers": true,
"importHelpers": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"experimentalDecorators": true,
"rootDirs": [".", "./dist"],
"baseUrl": "./src",
"rootDir": ".",
"paths": {
"@/*": [
"./*"
]
},
"plugins": [
{ "transform": "typescript-transform-paths", "useRootDirs": true, "afterDeclarations": true }
]
},
"include": [
"src/**/*.ts"
]
}
I just added
So my compiled files are in the |
@couellet I think you need 2 entries in the plugin section for the transformer to actually work: https://github.com/LeDDGroup/typescript-transform-paths#example-config
|
@danielpza that was it! Thank you so much. |
I will, but I need a reproduction |
- Several improvements were made for speed and efficiency. - Now accommodating for new TS empty baseURL provision (closes #109) - Pre-checking necessity before overwriting paths (closes #110) - Rewrote core resolution methodology to: - Properly handle implicit indexes (closes #106) - Properly handle implicit sub-package indexes set via package.json 'main' #108) - Not follow symlinks (#107) - Resolve from output path as opposed to SourceFile path (#103)
- Several improvements were made for speed and efficiency. - Now accommodating for new TS empty baseURL provision (closes #109) - Pre-checking necessity before overwriting paths (closes #110) - Rewrote core resolution methodology to: - Properly handle implicit indexes (closes #106) - Properly handle implicit sub-package indexes set via package.json 'main' #108) - Not follow symlinks (#107) - Resolve from output path as opposed to SourceFile path (#103)
- Several improvements were made for speed and efficiency. - Now accommodating for new TS empty baseURL provision (closes #109) - Pre-checking necessity before overwriting paths (closes #110) - Rewrote core resolution methodology to: - Properly handle implicit indexes (closes #106) - Properly handle implicit sub-package indexes set via package.json 'main' #108) - Not follow symlinks (#107) - Resolve from output path as opposed to SourceFile path (#103)
- Several improvements were made for speed and efficiency. - Now accommodating for new TS empty baseURL provision (closes #109) - Pre-checking necessity before overwriting paths (closes #110) - Rewrote core resolution methodology to: - Properly handle implicit indexes (closes #106) - Properly handle implicit sub-package indexes set via package.json 'main' #108) - Not follow symlinks (#107) - Resolve from output path as opposed to SourceFile path (#103)
Ok, all. I looked deeper into this and you were correct on it not resolving from |
Hey there. @nonara was it ever confirmed fixed. I am using |
The what would be nice is if this package had its own config where you could specify even an option like |
Uh oh!
There was an error while loading. Please reload this page.
Hi
likely my mistake, but I did not get it to work.
I have the following configuration (just keep relevant fields)
I have the following file:
../../src/eikon-framework/src/auth/auth-impl.ts
import { GetElectronEnvironment } from 'df-core/env';
after the compilation in the outDir folder I have
[outDir]/eikon-framework/auth/auth-impl.js
const env_1 = require("../../../products/workspace/build/df-core/env/index");
It seems the resolution has been done from the original location of TS file and not from the output location of JS file.
With "df-core/": ["./build/df-core/"] and outDir = ./build/eikon-framework/auth/auth-impl.js
I would expect
const env_1 = require("../../df-core/env/index");
Could you help me please
Thanks
The text was updated successfully, but these errors were encountered: