Making one Typescript project module depend on another
I'm having trouble making one of my Typescript modules, depend upon another Typescript module in my project. I have the following in place:
- Both modules have "include" statements in my top-level settings.gradle file
- In the depending module, I have "dependencies { project(':dependency_module') } in build.gradle
- In both modules, I'm using the Gradle plugin "com.github.node-gradle.node" version 3.1.0 in order to build and run my Typescript modules. (It's a plugin so I'm not expecting much support on that but I figured it's relevant information possibly)
- In my package.json for the depending module, I have "dependency_module": "file:../dependency_module", in the dependencies block.
What I am observing:
- Attempting to import an export from within my dependency module fails (TS2307, cannot find module or its corresponding type declarations. The item in question has an explicit 'export' statement and can be accessed within the dependency module, between files, just fine.
- This is in spite of the fact that one I open up node_modules in my depending module, I can see the symlink to my dependency module. I can also confirm that as I make changes to the files in the dependency, clicking to access them via the symlink does fetch the up to date file content.
I am admittedly very new to Typescript and Javascript, so I'm suspecting that I've missed some sort of declaration in the dependency module to make its exports fully available externally. I don't suppose there's anyone who's done a Gradle multi-module with Typescript who's done this successfully, that could tell me what I'm doing wrong?
Please sign in to leave a comment.