VSCode IntelliSense autocomplete aliased imports

Viewed 237

I'm using alias on the webpack.config.js as:

const srcDir = join(__dirname, '..', 'src');
const webpackConfig = {
  resolve: {
    alias: {
      "constants": `${srcDir}/constants",

And I have configured it on the jsconfig.json as:

{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "constants/*": ["./src/constants/*"],

My imports are in the format:

import CONSTANT from 'constants/constant';

It works for babel/webpack transpilation, but no for VSCode IntelliSense autocompletion.

I tried to play with the baseUrl and the paths, but no luck so far.

0 Answers
Related