Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

319
Views
How to get node subpath imports intellisense working

Recently, i started using subpath imports in my node project for mainly my utilities directory. It allowed me to go from

const { promptMessage } = require('../../../../utils/promptMessage.js');

to

const { promptMessage } = require('#utils/promptMessage.js');

The problem i have however, is that my intellisense is no longer working. I found some things with jsconfig.json, but those only seem to work on import statements, not require(). Is there a way to get intellisense with subpath imports?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In combination with the imports in package.json i was able to get back intellisense by creating a jsconfig.json file looking like this:

{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "#utils/*": ["./utils/*"],
            "#database/*": ["./database/*"],
            "#file": ["./dir/file.js"],
            "#colors": ["./commanddata/colors.json"]
        }
    }
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!