Jump to content
  • Advertisement
Sign in to follow this  
  • entry
  • comment
  • views

BabylonJS and TS. Debug, Release, Playground



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
  • Release. CommonJS + Browserify + UglifyJS. You should use it to create a bundle of your JS files for production

How to run my example:

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:

<!-- Debug -->
<script data-main="dist_client/RequireConfig"

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

In Program.ts:

// Debug

// 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


1 Comment

Recommended Comments

I copied this description to GitHub: 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: 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.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!