gpt-3.5-turbo-0301· openai
Suzhen/CodeChat
I'm doing this with slack bolt in my pakcage.json "start:app": "node ./dist/index.js",…
- User
I'm doing this with slack bolt in my pakcage.json
"start:app": "node ./dist/index.js", "build": "tsc"
But when it is compiled the paths are not being resolved properly.
For example this path
var _constants = require("../../../utils/constants");
should be
var _constants = require("../utils/constants");
- Assistant
To resolve this issue, you can update the "baseUrl" and "paths" properties in your tsconfig.json file.
Here's an example:
{ "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["src/*"], "@utils/*": ["src/utils/*"] } } }This sets the base URL to the root directory and defines two path aliases: "@/" and "@utils/". Now you can use these aliases in your code like this:
import { someUtil } from '@/utils/someUtil';And when you compile your code, the paths will be resolved correctly.