0

I have a jsconfig.json like the following:

{
  "compilerOptions": {
      "target": "es6",
      "module": "commonjs",
      "baseUrl": "./",
      "paths": {
          "@/*": ["src/*"]
      }
  },
  "exclude": [
      "node_modules",
      "**/node_modules/*",
      ".nuxt", "dist"
  ]
}

It works fine with imports such as:

import Config from '@/resources/config'
import Tests from '@/tests/suite.js'
import MyHeader from '@/components/MyHeader.vue'

BUT, it doesn't work with:

import MyHeader from '@/components/MyHeader'  # The "from" has no file extension

The resolver seems to work when the file extension is JS, VSCode is able to add it when searching for it if it isn't indicated, but not for .vue file.

How/where can I tell VSCode to also try to append the ".vue" file extension?

halfer
  • 19,824
  • 17
  • 99
  • 186
Cyril N.
  • 38,875
  • 36
  • 142
  • 243
  • Note that we prefer a technical style of writing here. We gently discourage greetings, hope-you-can-helps, thanks, advance thanks, notes of appreciation, regards, kind regards, signatures, please-can-you-helps, chatty material and abbreviated txtspk, pleading, how long you've been stuck, voting advice, meta commentary, etc. Just explain your problem, and show what you've tried, what you expected, and what actually happened. – halfer Mar 14 '23 at 13:35

0 Answers0