# Debug, Release, Playground using BabylonJS and TypeScript

**URL:** <https://forum.babylonjs.com/t/debug-release-playground-using-babylonjs-and-typescript/3767>\
**Category:** Demos and projects\
**Created:** [June 8, 2019, 2:35pm UTC](https://forum.babylonjs.com/t/debug-release-playground-using-babylonjs-and-typescript/3767 "2019-06-08T14:35:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![8Observer8](https://avatars.discourse-cdn.com/v4/letter/8/bbe5ce/32.png) [@8Observer8](https://forum.babylonjs.com/u/8Observer8)\
**Post date:** [June 8, 2019, 2:35pm UTC](https://forum.babylonjs.com/t/debug-release-playground-using-babylonjs-and-typescript/3767/1 "2019-06-08T14:35:29Z")

</div>

I will show how to use BabylonJS and TypeScript without Webpack, Gulp, Grunt and so on. Your examples will not be very heavy.

My example includes two versions:

- Debug. AMD + RequireJS. You should use it with Chrome extension for VSCode for breakpoints. And you can use it to public your multi file TypeScript examples on Playground like this: [Getting Started Example in TypeScript](https://plnkr.co/edit/YMWU5JxZ4R5b7NOSy2o4?p=preview)
- Release. CommonJS + Browserify + UglifyJS. You should use it to create a bundle of your JS files for production

How to run my example:

- You should to download my example here: [babylonjs-npm-getting-started-typescript.zip (6.7 KB)](https://forum.babylonjs.com/uploads/short-url/5onIeRhJNomZLESkyDuH8VGdFxq.zip) or from GitHub: [https://github.com/8Observer8/babylonjs-npm-getting-started-typescript](https://github.com/8Observer8/babylonjs-npm-getting-started-typescript)
- Install Browserify, UglifyJS and TypeScript globally:

> npm i browserify -g  
> npm i uglifyjs -g  
> npm i typescript -g

- Install the modules: babylonjs and @types/requirejs (that are included in my packages.json) using this command:

> npm install

- You should comment/uncomment Debug or Release versions:

In index.html:

```
<!-- Debug -->
<script data-main="dist_client/RequireConfig"
    src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>

<!-- Release -->
<!-- <script src="dist_client/bundle.client.min.js"></script> -->

```

In Program.ts:

```
// Debug
Program.Main();

// Release
// window.onload = () => Program.Main();

```

- Build Debug Version using this command:

> npm run build-debug-client

- Or build Release Version using this command:

> npm run build-release-client

---

<div class="post-metadata">

**Author:** ![withADoveInOneHand](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/withadoveinonehand/32/1243_2.png) [@withADoveInOneHand](https://forum.babylonjs.com/u/withADoveInOneHand)\
**Post date:** [June 8, 2019, 3:52pm UTC](https://forum.babylonjs.com/t/debug-release-playground-using-babylonjs-and-typescript/3767/2 "2019-06-08T15:52:04Z")

</div>

I’m for it

---

<div class="post-metadata">

**Author:** ![8Observer8](https://avatars.discourse-cdn.com/v4/letter/8/bbe5ce/32.png) [@8Observer8](https://forum.babylonjs.com/u/8Observer8)\
**Post date:** [June 11, 2019, 2:00pm UTC](https://forum.babylonjs.com/t/debug-release-playground-using-babylonjs-and-typescript/3767/3 "2019-06-11T14:00:16Z")

</div>

I copied this description to GitHub: [GitHub - 8Observer8/babylonjs-npm-getting-started-typescript: Debug, Release, Playground using BabylonJS and TypeScript](https://github.com/8Observer8/babylonjs-npm-getting-started-typescript)

I wanted to add specs to BabylonJS projects to Debug and Release versions. I will use Jasmine. I made this simple example using TypeScript: [Plunker](https://plnkr.co/edit/77Ex6gPTBxQyyXNML9tk?p=preview)

You can run the unit test by clicking on “Run Unit Tests” button. But this example does not use Mock-objects. I will make an example how to mix Jasmine mocks and BabylonJS together. I like to write unit tests for my code.
