I'm working in a build system which is... different.
.d.ts
files) are generated by the build system and these are in a different path or loaded from yet another FUSE filesystem. So I end up with things like
// hmm, is this the right number of ..'s to
// get up to the shared DefinitelyTyped repo?
/// <reference path='../../../../../typings/angularjs/angular.d.ts' />
and a lot of code shuffling files around inside the build system to lay out a file structure mimicking what tsc expects.
These problems are due to relying exclusively on the tsc behavior of resolving /// <reference/>
tags relative to the path of the file in which it appears. What I would really like is to give a stack of absolute paths which should be resolved by checking in order:
Does anyone have a workaround for loading files a different way (like a custom compiler frontend on top of the language services API?) Has the core TS team considered a feature like this?
Does anyone have a workaround for loading files a different way
You can use grunt-ts
transforms to resolve the relative path issues for you : https://github.com/TypeStrong/grunt-ts#transforms
(like a custom compiler frontend on top of the language services API?)
Atom-TypeScript has a compilation context determined from tsconfig.json
: https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md so you don't need to reference files. But you will still need to import them for external modules. I am working on making it easier to generate these for you (one of the reasons I created atomts).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.