I'm trying to build a monorepo using lerna+typescript, I'm using this repo as a start: https://github.com/Izhaki/mono.ts
What i'm trying to achieve is to debug the code inside visual studio code. I've tried something to add the launch.json
like this:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug",
"preLaunchTask": "npm: build",
"program": "${workspaceFolder}/packages/line/src/index.ts",
"sourceMaps": true,
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"outFiles": [
"${workspaceFolder}/packages/line/dist/**/*.js"
]
}
]
}
I'm getting some error about he import and the use of:
/Users/davidericci/Desktop/mono.ts-master/packages/line/dist/index.js:1
(function (exports, require, module, __filename, __dirname) { import { getDistance } from '@geo/point';
^
SyntaxError: Unexpected token {
so I've changed inside the tsconfig.build.json
(inside packages):
"target": "es2017",
"module": "commonjs",
and inside the tsconfig.base.json
(always inside packages):
{
"compilerOptions": {
"lib": ["es2015", "es2016", "dom", "es2017", "es6", "es5"],
"noUnusedLocals": true
}
}
but i'm still getting:
internal/modules/cjs/loader.js:605
throw err;
^
Error: Cannot find module '@geo/point'
as error, I think because inside the code (even in the JS code) the import still points to the typescript. I may be wrong here.
all other settings are default for that project.
can be something with tsconfig-paths
? or is just some setting inside the launch.json?
Thank you very much guys