-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
Problem
When TS_NODE_PROJECT environment variable is defined, the config path will be detected incorrectly and the plugin will not work.
The configFile configuration parameter will be ignored even if provided.
Example:
| Command | Resulting Using config file at ... output |
Correct? |
|---|---|---|
webpack |
...client/management/tsconfig.json |
✅ |
TS_NODE_PROJECT=tsconfig.json webpack |
...client/management/tsconfig.json/tsconfig.json |
❌ |
TS_NODE_PROJECT=tsconfig.tools.json webpack |
...client/management/tsconfig.json/tsconfig.tools.json |
❌ |
Use case
I have two TS config files - main and tooling.
Main:
"compilerOptions": {
...
"module": "esnext",
"moduleResolution": "bundler",
"paths": {
"@root/*": ["./src/app/*"]
}
},
Tooling:
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node"
},
However, invoking webpack via TS_NODE_PROJECT=tsconfig.tools.json webpack breaks tsconfig-paths-webpack-plugin.
Workaround
- Create a wrapper script that registers tooling TS project and invokes webpack CLI programmatically.
- Provide explicit main config file to the
tsconfig-paths-webpack-pluginviaconfigFileproperty.
Metadata
Metadata
Assignees
Labels
No labels