-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Versions 1.6.2 and higher no longer replaces aliases #100
Comments
@gbenson-ff Please try upgrade to |
Upgrading to |
Is |
This is on Linux. |
It seems I can't reproduce this bug. {
"compilerOptions": {
"target": "ES2017",
"module": "commonjs",
"declaration": true,
"outDir": "./dist",
"declarationDir": "./dist",
"baseUrl": "./",
"paths": {
"~*": ["./src/*"]
}
}
} @justkey007 can you take a look at this? |
I think I've narrowed it down a bit. The tsconfig I'm using in this project extends a tsconfig from an npm package. Here's the two:
{
"extends": "@formfree/tsconfig/base.json"
}
{
"extends": "@tsconfig/recommended/tsconfig.json",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": "../../../",
"declaration": true,
"declarationMap": true,
"declarationDir": "../../../dist",
"importHelpers": true,
"importsNotUsedAsValues": "error",
"jsx": "preserve",
"lib": ["esnext", "dom", "dom.iterable"],
"module": "esnext",
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"outDir": "dist",
"paths": {
"~*": ["./src/*"]
},
"resolveJsonModule": true,
"sourceMap": true,
"target": "esnext"
},
"include": [
"../../../src/*.ts",
"../../../src/**/*.ts"
],
"exclude": [
"../../**/*",
"../../../dist/**/*"
]
} If I instead dump the contents of I was using this exact same setup before with |
@gbenson-ff can you provide us with a repo reproducing the bug in order to quickly resolve this problem? |
@gbenson-ff can you provide us the console output when running with let loggedConfig = true;
exports.default = ({ orig, file, config }) => {
if (loggedConfig) {
console.log(config);
loggedConfig = false;
}
console.log(orig);
console.log(file);
return orig;
}; |
@justkey007 Sure, I can. It'll take me a minute, but I'll comment here again when I have something up. @raouldeheer I did what you said, but got no console output. |
No output means that it found no import statements. |
@raouldeheer Sure, here's the output: > tsc --emitDeclarationOnly --outDir dist && tsc-alias -r debugger.js
{
configFile: '/home/gabe/Coding/work/v2/frontend/packages/common/tsconfig.json',
baseUrl: '../../../',
outDir: '/home/gabe/Coding/work/v2/frontend/packages/common/node_modules/@formfree/tsconfig/dist',
configDir: '/home/gabe/Coding/work/v2/frontend/packages/common',
outPath: '/home/gabe/Coding/work/v2/frontend/packages/common/node_modules/@formfree/tsconfig/dist',
confDirParentFolderName: 'common',
hasExtraModule: false,
configDirInOutPath: null,
relConfDirPathInOutPath: null,
pathCache: PathCache {
useCache: true,
existsCache: Map(0) {},
absoluteCache: Map(0) {}
},
output: Output { verb: false },
aliasTrie: TrieNode { children: Map(1) { '~' => [TrieNode] }, data: null },
replacers: [
[Function: replaceImportStatement],
[Function: replaceBaseUrlImport],
[Function (anonymous)]
]
}
{
configFile: '/home/gabe/Coding/work/v2/frontend/packages/common/tsconfig.json',
baseUrl: '../../../',
outDir: '../../../dist',
configDir: '/home/gabe/Coding/work/v2/frontend/packages/common',
outPath: '../../../dist',
confDirParentFolderName: 'common',
hasExtraModule: false,
configDirInOutPath: null,
relConfDirPathInOutPath: null,
pathCache: PathCache {
useCache: true,
existsCache: Map(0) {},
absoluteCache: Map(0) {}
},
output: Output { verb: false },
aliasTrie: TrieNode { children: Map(1) { '~' => [TrieNode] }, data: null },
replacers: [
[Function: replaceImportStatement],
[Function: replaceBaseUrlImport],
[Function (anonymous)]
]
} @justkey007 I've put together a repo to reproduce my scenario: https://github.com/gbenson-ff/tsc-alias-bug If you clone it, run |
It has loaded the config correctly. |
Found the problem, pushing fix soon. |
* Fix: relative tsconfig paths This issue should fix #100 * Fixed typo
After upgrading
tsc-alias
to1.6.2
from1.6.1
, the tool seemingly no longer works.I have a single entry in
paths
in mytsconfig.json
:I build my types with the following command:
tsc --emitDeclarationOnly --outDir dist && tsc-alias
Previously it worked without issue. After the upgrade, tilde paths in my
.d.ts
files are no longer replaced with relative paths.I'm happy to provide more info, just let me know what's needed!
Versions
Node - 17.6.0
NPM - 8.5.2
tsc-alias - 1.6.2
The text was updated successfully, but these errors were encountered: