When writing a code that will be later pushed through webpack, it is possible to use custom loaders for non-standard files. In effect it is possible to write
import image from './assets/image.png';
and it will be properly handled. The problem is VSCode doesn't provide autocompletion for files like .png
, .svg
, .scss
and so on.
Is it possible to do so by some settings or an extension?
I was able to fix it using Path Autocomplete extension. By default it does not include file extensions and suggests the .js files in addition to the default suggestions by VS Code. It can be changed by adding the following lines to the User Settings:
"path-autocomplete.extensionOnImport": true,
"path-autocomplete.excludedItems": {
"**/*.js": {"when": "**"}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With