I'm trying to build a webstorm project where I code both the server (node) and the client in typescript.
My project directory is as follows (directory names changed for easier comprehension):
--(other client directories)
--(server source directories)
My problem comes up because I'm using a different module system for server and client. Server needs to use commonjs modules, and I want to use Systemjs for the client side modules. Also because systemjs transpiles to es5 I wish to target es6 in the client, but es5 on the server (at least for now).
My first thought would be to have two tsconfig files in the project, but webstorm seems to be confused. Even when I explicitly set all the files for both .tsconfig files (using the handy https://www.npmjs.com/package/tsconfig-glob utility), I can't seem to get it to work.
Currently I have one .tsconfig file in the server_source directory, and another in the client_source directory, each with their proper settings. However on compilation, the tsc compiler only compiles the client code. If I put the server tsconfig.json in the root directory, it attempts to use its settings to compile the client files, leading to errors.
I haven't even tried to accomplish this yet, but matters are further complicated by the fact that I have certain code that needs to be shared by both the client and the server.
The small amount I could find online seemed to indicate that webstorm does indeed support multiple tsconfig files but I couldn't find anything on how that support is supposed to work. If anyone could shed some light on the subject I would be very grateful.