admin管理员组

文章数量:1395123

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 ?

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 ?

Share Improve this question edited Mar 28, 2019 at 0:23 N8888 6702 gold badges14 silver badges21 bronze badges asked Jul 4, 2018 at 16:56 Farooq HanifFarooq Hanif 1,9192 gold badges16 silver badges25 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 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

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"}
    }
}

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.

本文标签: javascriptHow to show js file under ts file in VS CodeStack Overflow