Custom file resolver when compiling ts to js

41 views Asked by At
src
   -custom
        -src
           -common
                -app
                    file.ts(custom implementation)
   -common
        -app
           file.ts(actual implementation)

I have my project structured in this way, my project will be used as a library. I need a way so that when I compile my ts files to js, files for which a custom file exists that gets compiled instead of the actual one. The custom file will have some custom logic and it may contain some imports from both custom dir and the actual common dir.

Any idea of how I might be able to achieve this?

I have tried writing a custom plugin for tsc, using ttypescript package.

0

There are 0 answers