3

I am using VS Code for an application in which I am using Reactjs and TypeScript. I have used

create-react-app-typescript

as a template to set up my project. Now when I run the build task from VS Code, I can see a build folder and the generated js files there as well as the generated source files.

I am wondering if I can see generated .js file under its .ts version in VS Code - like you can see those together in Visual Studio ?

3 Answers 3

5

For anybody who finds this: There is (now) a built-in setting Explorer > File Nesting which does exactly this. You can also configure the pattern of nesting under Explorer > File Nesting: Patterns

Sign up to request clarification or add additional context in comments.

Comments

3

I'm a VSCode Typescript user. I've never seen that feature is available in VSCode. One thing that I usually do is to hide its javascript files on the sidebar.

{
    "files.exclude": {
        "**/.git": true,
        "**/.DS_Store": true,
        "**/*.js": {"when": "$(basename).ts"}
    }
}

Comments

3

I had a tsconfig file in my application's folder, in which

"outDir": "build/dist" 

was causing generated files to go into build/dist folder. Removing this for tsconfig.json file will place generated files along with original .ts files in VS Code.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.