How to build and link babylon.js locally


#1

Hey!

I’m trying to get web xr going, but chrome seems to have done some changes, so BJS doesn’t want to work.

So as the nifty programmer I am i thought i could fork and npm link BJS into my app to be able to do some debugging and changes.

But I’m struggling with getting the build up and running.

I’m using the @preview release so I’m importing from @babylonjs/core

Should I use the preview branch or the master branch?
Should it suffice to run gulp run from ./Tools/Gulp/ to make it rebuild BJS?

How are you doing npm linked development against BJS?

// Leon


#2

Here we are:
https://doc.babylonjs.com/how_to/how_to_start

You should have everything you need here!


#3

Thanks!
I was able to get it running.

Though I miss the typescript intellisense in localDev :slight_smile:


#4

In Local dev add this at the top of your script :
/// <reference path="…/…/dist/preview release/babylon.d.ts"/>

As a huge plus, you can run gulp npmPackages-es6

This will create all the Babylon packages in a temp folder and properly link them for you. Then in your local app a simple npm link @babylonjs/… will make it target your local version


#5

Thanks, I’ll give it a go :slight_smile: