You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cap'n Proto schemas admit absolute imports that search command-line-parametrized include directories, e.g. capnp compile -ots -I /path/to/reusable/stuff/ some-schema.capnp. I've got an example repo: https://github.com/popham/ts-absolute-import-example (npm run compile generates). Currently my import using Lib = "/lib-file.capnp" gets mapped to import { A } from ".//lib-file.capnp".
I ask because I've been implementing a plugin targeting Flow, but it turns out that emitting TypeScript and plain JavaScript demands only a tiny bit of extra code. Unfortunately, I don't know much of anything about TypeScript, so I have no idea how absolute imports could be supported in this ecosystem. Under Flow I think that I can hack them together with name_mapper under .flowconfig and babel-plugin-module-resolver. My favorite option currently is some sort of "emit includable" option that generates an index file (I've been working to avoid an index blob by default because I expect it to spoil dead code elimination tools). I'm not at all fond of my favorite, however.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Cap'n Proto schemas admit absolute imports that search command-line-parametrized include directories, e.g.
capnp compile -ots -I /path/to/reusable/stuff/ some-schema.capnp
. I've got an example repo: https://github.com/popham/ts-absolute-import-example (npm run compile
generates). Currently my importusing Lib = "/lib-file.capnp"
gets mapped toimport { A } from ".//lib-file.capnp"
.I ask because I've been implementing a plugin targeting Flow, but it turns out that emitting TypeScript and plain JavaScript demands only a tiny bit of extra code. Unfortunately, I don't know much of anything about TypeScript, so I have no idea how absolute imports could be supported in this ecosystem. Under Flow I think that I can hack them together with
name_mapper
under.flowconfig
andbabel-plugin-module-resolver
. My favorite option currently is some sort of "emit includable" option that generates an index file (I've been working to avoid an index blob by default because I expect it to spoil dead code elimination tools). I'm not at all fond of my favorite, however.The text was updated successfully, but these errors were encountered: