Jump to content

Developing a game in TypeScript + Sublime Text + Gulp + BabylonJS


BeanstalkBlue
 Share

Recommended Posts

I have made a basic gulp file following Techemon's code (he uses grunt though) here: https://github.com/Temechon/Babylon.js-FPS

I notice he is using babylon.2.3.d.ts. (Not 2.5 or 2.6.)

With my gulp build I am able to compile my project with babylon.2.3.d.ts and everything compiles successfully.

With sublime text if I build (using the official typescript sublime text plugin) with babylon.2.5.d.ts, it compiles my game.ts file successfully, no errors.

But if I try to use babylon.2.5.d.ts with gulp using gulp-typescript, I get the following compilation error:

node_modules/typescript/lib/lib.d.ts(5603,11): error TS2320: Interface 'AudioContext' cannot simultaneously extend types 'AudioContextBase' and 'EventTarget'.
  Named property 'addEventListener' of types 'AudioContextBase' and 'EventTarget' are not identical.

Am I doing something wrong? Is this a bug with babylon 2.5?

Does anyone have an example gulpfile.js (preferably with browserify+tsify) that compiles their TypeScript game successfully with a recent version of Babylon?

 

 

I don't know if it's relevant but here is my gulpfile.js:

 

'use strict';

var gulp = require('gulp');
var ts = require("gulp-typescript");
var sourcemaps = require('gulp-sourcemaps');

var paths = {
    ts: [
        'babylon.2.5.d.ts',
        'game.ts',
    ]
};

gulp.task("ts1", function () {
    return gulp.src(paths.ts)
        .pipe(
            ts({
                module: 'amd',
                target: 'es5',
                declaration: false,
                sourceMap:true,
                removeComments:false,
                out: 'dist'
            })
        );
});

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...