babel-plugin-tsconfig-paths-module-resolver icon indicating copy to clipboard operation
babel-plugin-tsconfig-paths-module-resolver copied to clipboard

Custom tsConfig path

Open ondrej-111 opened this issue 2 years ago • 1 comments

Please provide the option to specify a custom tsConfig, something like this:

[
      'babel-plugin-tsconfig-paths-module-resolver',
      {
        "tsConfig": "apps/functions/tsconfig.app.json",
      }
    ]

ondrej-111 avatar Nov 15 '22 07:11 ondrej-111

You can work around this limitation by setting an environment variable pointing to the required tsconfig file before this plugin is initialized and before calling createResolvePath(). If you have a babel.config.js you can do something like:

process.env.TS_NODE_PROJECT = path.join(<someRootPath>, 'tsconfig.base.json');

before exporting the plugin configuration.

https://github.com/dividab/tsconfig-paths#config-loading-process

bsantare avatar Feb 03 '23 14:02 bsantare