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

BabylonJS and TS. Debug, Release, Playground

8Observer8

818 views

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

 



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!