6

Some projects I work on use .es6 extension for JavaScript files that import/export using ES6 module syntax.

While webstorm and webpack seem to have no issues with this setup, VSCode gives a red squiggly saying [js] Cannot find module './filename.es6'.

Is there some way to get VS Code to find modules imported that do not have a .js extension? We would like to use .jsx in a similar fashion.

I have this for a .jsconfig:

{
    "compilerOptions": {
        "target": "ES6",
        "module": "commonjs"
    },
    "files": [
        "**/*.jsx",
        "**/*.es6",
        "**/*.js"
    ]
}

...and tried adding .es6 under user settings for VSCode, but suspect I did it wrong or that doesn't solve the issue.

aikeru
  • 3,773
  • 3
  • 33
  • 48

0 Answers0