# Visual Studio Code BJS TS Sourcefiles

**URL:** <https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373>\
**Category:** Questions\
**Created:** [August 30, 2019, 9:07am UTC](https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373 "2019-08-30T09:07:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![holger](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@holger](https://forum.babylonjs.com/u/holger)\
**Post date:** [August 30, 2019, 9:07am UTC](https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373/1 "2019-08-30T09:07:27Z")

</div>

Hi,  
I’m using Visual Studio Code for development. When I click “go to definition” of a BJS object, say for instance `Mesh.CreateGroundFromHeightMap`, VSC takes me to `babylon.module.d.ts`. How can I convice VSC to actually open the correct `*.ts` source-file and not the module-file?

Furthermore I’ve noticed that under `node_modules/babylonjs` are no `*.ts` files expect the `babylon.module.d.ts`. When stepping into BJS source while debugging `node_modules/babylonjsbabylon.js` is opened, again also here it would be nice if the correct `*.ts`would open.

I guess I’m missing something  
Any help appreciated,  
Regards

---

<div class="post-metadata">

**Author:** ![Galen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/galen/32/539_2.png) [@Galen](https://forum.babylonjs.com/u/Galen)\
**Post date:** [August 30, 2019, 11:09am UTC](https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373/2 "2019-08-30T11:09:05Z")

</div>

Hello,

If you haven’t already, you’ll need to add reference to the babylonjs packages you installed on your system. This is done in the tsconfig.json file. If you haven’t already, you’ll need to create a tsconfig.json file. The command for this is “tsc --init”.

Then edit the file and add the imported packages as “types” of “compilerOptions”. If this isn’t clear then reference the docs as they are very well written:

[https://doc.babylonjs.com/features/npm\_support](https://doc.babylonjs.com/features/npm_support)

If you’ve done all of this and still have issues, then I would ping @trevordev as he initially created a github repo to provide code to get started quickly. I don’t know the specific URL, but it should be easy to search on github and it’s worth referencing.

Galen

---

<div class="post-metadata">

**Author:** ![Galen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/galen/32/539_2.png) [@Galen](https://forum.babylonjs.com/u/Galen)\
**Post date:** [August 30, 2019, 11:37am UTC](https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373/3 "2019-08-30T11:37:51Z")

</div>

Actually, the repo wasn’t that easy to search for. So here it is:

> **[TrevorDev/testProjectBabylon](https://github.com/TrevorDev/testProjectBabylon)**
>
> Contribute to TrevorDev/testProjectBabylon development by creating an account on GitHub.

This will help anyone who has not used babylon,js with typescript previously. By the way @trevordev - great pic!

Galen

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 30, 2019, 11:46am UTC](https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373/4 "2019-08-30T11:46:19Z")

</div>

@holger, if I understand correctly what you would need here is called declarationMap in TS which creates .map for declaration files.

As we are manually creating and updating the .d.ts files for various reason in BJS, it is a feature we can not support with the UMD bundled package. This is nevertheless a great idea for the es6 version of the package.

I will see how are this would be to add to it.

---

<div class="post-metadata">

**Author:** ![holger](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@holger](https://forum.babylonjs.com/u/holger)\
**Post date:** [August 30, 2019, 4:13pm UTC](https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373/5 "2019-08-30T16:13:11Z")

</div>

@Galen  
Thanks for the hints, I’ll check against my tsconfig and adapt the missing parts  
@sebavan  
If I understand correctly there is currently no way to have the full ts-source file of a class shown in VSC.  
As for example not only having the `babylon.module.d.ts` version of a texture’s constructor when clicking on it, but having the fully fledged source like `https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/Textures/texture.ts`  
Thanks again,  
Regards

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 30, 2019, 4:15pm UTC](https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373/6 "2019-08-30T16:15:39Z")

</div>

yup you are right, we provide map files for runtime and debugging (.js.map), not for development time (.d.ts.map) as they can not be generated in our umd build.

---

<div class="post-metadata">

**Author:** ![holger](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@holger](https://forum.babylonjs.com/u/holger)\
**Post date:** [August 31, 2019, 9:31am UTC](https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373/7 "2019-08-31T09:31:58Z")

</div>

Ok, thanks for clarification.  
One more question: When I’m debugging with the “Debugger for Chrome” extension and stepping into babylon source the minified file `babylon.js` is used which I asume is `node_modules/babylonjs/babylon.js`. I’ve noticed that in `node_modules/babylonjs` is also `babylon.max.js`. Is there a way to convince the debugger to use this version instead the minified one?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 31, 2019, 2:08pm UTC](https://forum.babylonjs.com/t/visual-studio-code-bjs-ts-sourcefiles/5373/8 "2019-08-31T14:08:42Z")

</div>

It mostly depends on your toolset, but most of the time you can redirect dependencies to the files you want like using paths in tsConfig for instance.
