I set the property paths in the tsconfig.json file, like:
"paths": {
"*": [
"*",
"src/*",
"node_modules/*"
],
"src/*": [ "./src/*" ]
},
And it gets me to be able to take some module more easy: e.g.
- src
|- moduleA
|- utils
|- moduleB
// moduleA
import { something } from 'utils/moduleB'
but after compile I get next path in the moduleB.js:
something = require('utils/moduleB')
instead of relative path:
something = require('./utils/moduleB')
It doesn't work under Node because Node module resolution system knows nothing about utils folder.
So, how can I force tsc to use relative paths here?
via yiooxir
No comments:
Post a Comment