how to absolute path from nodejs

Viewed 13

import 'config/config' in the first picture There is an error and the import '../config/config' below works well, so I want to specify the path as above, but it doesn't work well even if I modify tscconfig as below. Is there a way? But it works well in reaction, but why is it a problem in node

enter image description here

[models/index.ts]
import { Sequelize } from 'sequelize';
import development from 'config/config';

const sequelize = new Sequelize(
  development.database,
  development.username,
  development.password,
  {
    host: development.host,
    dialect: 'mysql',
  },
);

export default sequelize;


import development from '...config/config';
{
  "compilerOptions": {
    "baseUrl": "src"
  },
  "includes": ["src"]
}
0 Answers
Related