Gustavo Lopes
Gustavo Lopes

Reputation: 21

VSCode javascript not recognize imports

How do I get my vscode to list all files when performing an import? It only recognizes .js .ts .jsx .tsx files

But it doesn't recognize images, css or any other files during import.

Do you have an extension for this? Or should I add something to my vscode config.json?

I have a styles.module.css file in the folder ToggleBar but it is not listed when i use ./ from import. The same happens with images, svgs etc...1

Upvotes: 0

Views: 1484

Answers (1)

Sowmen Rahman
Sowmen Rahman

Reputation: 373

The import statement only works for ES6 JS/TS modules, which the CSS and image files are not. Configuring the jsconfig.json file will not help in this context, as images and other assets like css and sass files are not ES6 modules which the compiler can discover.

Upvotes: 1

Related Questions