Repository navigation
Path mapping module resolution - #5728
Conversation
|
I suppose this can solve problems I had using angular2 with jspm with Visual Studio. How can try if this works? |
|
Great, I'll try this out as soon as it is merged :) |
There was a problem hiding this comment.
form1.content.ts is form.content.ts
|
can you add test with suffix in paths matching like "paths": {
"generated/*/folder1" : ["build/folder1"]as well as the case when there are multiple match but we pick the longest one (so we have a record of what we use to do in case of future change) |
|
Also what happens in this case: "rootDirs": [
"*",
"generated/*"
],is this allowed? if so could we have some tests as well? (from the spec, it seems so. I can't tell from the comment though) "rootDirs": [
"*",
"generated/*/folder1"
], |
|
|
Can you enable the |
|
Sure, I'll add it in the next iteration of this PR |
|
Here is my folder structure libs/guid/package.json: {
"name": "guid",
"version": "1.0.0",
"main": "dist/guid.js",
"typings": "dist/guid.d.ts"
}app/app.ts: import guid from 'libs/guid';
console.log(guid());app/tsconfig.json {
"compilerOptions": {
"declaration": true,
"module": "commonjs",
"noImplicitAny": true,
"removeComments": false,
"sourceMap": true,
"outDir": "dist/",
"target": "es5",
"moduleResolution": "baseUrl",
"baseUrl": "",
"paths": {
"libs/guid": ["../libs/guid/dist/guid.d.ts"]
}
},
"exclude": [
"dist"
]
}Rather than specifying paths as |
|
Also how do I set path mappings in csproj? |
|
I'm currently making a few adjustments to this PR based on results of the latest design meeting and I think that your initial scenario should be supported. Regarding specifying path mappings in .csproj - this won't work, |
There was a problem hiding this comment.
In your proposal example, it shows paths can be defined as the follows:
"pattern-1": "substitution" | ["list of substitutions"]
However, when const subst of compilerOptions.paths[matchedPattern] is ran, if my path's substitution is a string, of will iterate over each character of the string. Does this need to change or perhaps normalize the compiler options?
There was a problem hiding this comment.
the proposal needs to be adjusted - it should always be the list
|
Vladimir Matveev (@vladima) Would really love to see it working in csproj since that is what we are using internally. I was expecting something like this in csproj. <TypeScriptPath>
<Pattern>libs/guid<Pattern>
<Substitution>../libs/guid</Substitution>
<TypeScriptPath> |
There was a problem hiding this comment.
Leave a line note
There was a problem hiding this comment.
remove "baseURL" from the message
There was a problem hiding this comment.
done
|
👍 |
Path mapping module resolution
|
which version of typescript and gulp-typescript support this? |
|
initial implementation for this proposal: #5039.