TS-JS-PATH-RESOLVE
Use the "NODE_PATH hack" to add new path from tsconfig.json where nodejs should search for modules. *Works with
typescript@>=2.0
and only with -unix OS.
Installation
npm install ts-js-path-resolve --save-dev
Usage
rootDir|/src | /lib | main.ts | /lib2 | /lib3 | index.ts
// ts-config.json "compilerOptions": "module": "commonjs" "target": "es5" "baseUrl": "./src" "paths": "*": "./li/*" "lib/*": "./lib/*" // now can require some modules as:// src/main.ts;;;const configPath = path; //add absolute path to tsconfig.json; ;; // now import currectly work after compiling
flags
- --logs, -LG Get a logs display how change NODE_PATH
License
MIT