# New build system in our main repository

**URL:** <https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483>\
**Category:** Announcements\
**Created:** [March 16, 2022, 8:05pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483 "2022-03-16T20:05:59Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [April 6, 2022, 11:40am UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/41 "2022-04-06T11:40:00Z")

</div>

Am I right in thinking that if I now want to download any of the Babylon.js files, eg max, min, loaders, gui etc. in JavaScript form they will not be available in the Babylonjs repository and then one way would be a browser search for `jsdelivr babylon.js` select the appropriate link and download the required file from the jsdelivr page?

---

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [April 6, 2022, 12:03pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/42 "2022-04-06T12:03:51Z")

</div>

I’m doing this as a workaround. and it works. (I don’t know if .d.ts also go in the cdn?)  
I share it in case someone wants to do the same.  
'when this code is executed, it creates or updates the local javascript file from the remote file  
**PS:** It is necessary if the server is local (easyphp, wamp) to activate extention : _extension=php\_openssl.dll_

```auto
<?php	
$arrContextOptions = array("ssl" => array("verify_peer"=>false, "verify_peer_name"=>false));
$babylonFile = file_get_contents("https://preview.babylonjs.com/babylon.js", false, stream_context_create($arrContextOptions));	
$localProjet = "../my_project/libs/babylon/";
file_put_contents($localProjet."babylon.js", "".$babylonFile."");	
?>

```

Do the same with the other files gui, materials, inspector…

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 6, 2022, 12:12pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/43 "2022-04-06T12:12:49Z")

</div>

Yes, the files will not be available in the repository anymore. There are different reasons behind it (and the main one being that we were updating a log of minified files on a daily base, which led to the repository being bloated with unneeded changes).  
There are different ways of downloading all of the files, the best and simplest one is downloading them from our CDN. there is no need to use jsdeliver, we have an updated CDN for you 🙂  
Setting up the repository for build shouldn’t take long (apart from the time it takes for the repo to clone). If you have node 12+ and npm 7+ installed, it is (theoretically) as easy as:

1. clone repository
2. run npm install
3. run npm build:umd
4. run npm prepare-snapshot

All files will be in the .snapshot directory

Once you have the repository already cloned you only need to run the last 2 steps next time to get the files you need.

Also, running `npm install babylonjs` in a new empty directory will work perfectly as well. It will pack the files in the node\_modules directory, but otherwise it is the built version of the package that you are looking for. local and ready to be used. Run `npm update babylonjs` in the same directory, and you will get the latest stable version (if any is available).

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [April 6, 2022, 3:09pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/44 "2022-04-06T15:09:07Z")

</div>

Thank you. That clears up a lot for me, except for one point.

> [@RaananW](#):
>
> the best and simplest one is downloading them from our CDN

A  
I understand that I can “download” the required files in html as in

```javascript
<script>src="https://cdn.babylonjs.com/babylon.js"></script>

```

B  
What I do not know if by “our CDN” you also mean a site that lists all the possible current Babylon.js javascript files which can be individually downloaded?

My assumption is that only A is true.

Would you please confirm if its A, B or A and B.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 6, 2022, 3:22pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/45 "2022-04-06T15:22:01Z")

</div>

A is right 🙂

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 7, 2022, 8:51am UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/46 "2022-04-07T08:51:22Z")

</div>

@JohnK , @Dad72 ,

I have added auto-release creation to the publish pipeline. Each github release will include a zip file with a snapshot of the CDN structure:

[Releases · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/releases)

Starting this version it will include this zip file. Hope this solves the issue 🙂

---

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [April 7, 2022, 11:12am UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/47 "2022-04-07T11:12:44Z")

</div>

Thanks RaananW for adding this. This gets the files for local use.  
But why everything goes in a zip file and not directly put this zip structure in the repository?  
Anyway, thanks for this addition.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 7, 2022, 1:12pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/48 "2022-04-07T13:12:17Z")

</div>

We try to avoid big files in the repo because else it takes ages to clone/fork and build (for our CI)

---

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [April 7, 2022, 1:49pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/49 "2022-04-07T13:49:50Z")

</div>

I wrote a solution to update quickly with PHP. [here](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/42) .  
I take the content in : [https://preview.babylonjs.com/babylon.js](https://preview.babylonjs.com/babylon.js) and I rewrite everything to a file locally. (dynamic copy paste). This solution works well.

---

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [April 8, 2022, 12:45pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/50 "2022-04-08T12:45:32Z")

</div>

I do not know where it is, but there is a CDN site where almost every release is. I myself, was thinking about putting a reference to the URL of the specific version as a `<!-- Commented specific version Url -->` when published, because that is when I know the current version the scene was made with.

If for any reason the current CDN no longer works, then it is a 2 minute change. Don’t need to remember what version to try. Some of my old scenes stop running when the location of `extractMinMax()` was moved.

I am currently re-thinking a dedicated Github pages repo. It is just a floating garbage bag of scenes. I think you can add pages to any repo now, so each scene can be its own repo. Us mere mortals, cannot pull off a monorepo like @RaananW . Has anyone tried this yet?

* * *

Edit:

> **[cdnjs - The #1 free and open source CDN built to make life easier for developers](https://cdnjs.com/libraries/babylonjs)**
>
> Simple. Fast. Reliable. Content delivery at its finest. cdnjs is a free and open-source CDN service trusted by over 12.5% of all websites, serving over 200 billion requests each month, powered by Cloudflare. We make it faster and easier to load...

* * *

Edit 2:  
Forgot to mention that candidates for using a single scene Github pages are probably not going to have any typescript. I keep that to libraries. Transpiling requires a 64 mb `node_modules` sub-directory.

Obviously, I would git ignore that, but seems wrong for all but the most demanding scenes.

---

<div class="post-metadata">

**Author:** ![MarianG](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mariang/32/138_2.png) [@MarianG](https://forum.babylonjs.com/u/MarianG)\
**Post date:** [April 14, 2022, 12:33pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/51 "2022-04-14T12:33:15Z")

</div>

Hey, I wanted to upgrade babylonjs to the latest version in an old project, not es6, … and I didn’t find any link or info about from where I can download babylonjs ☹ , other than this

> **[Framework Versions | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/developWithBjs/frameworkVers)**
>
> Learn about the different versions of Babylon.js.

which is not quite completed, I mean I have loaders, inspector, gui, … from where I can take those? …

I solved my problem downloading the assets from github releases, … all good, … but it wasn’t my first option ☹  
We have thousand pages of documentation and we don’t have a page clear page where to write click this to get this… I don’t think it is ok to try workarouds like @Dad72 to get the babylonjs files. Cheers!

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 14, 2022, 1:21pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/52 "2022-04-14T13:21:00Z")

</div>

Tagging @PirateJC about docs - might be interesting to add a “releases” section on the docs with a list of versions, like what we’d find in [Download Python | Python.org](https://www.python.org/downloads/)

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [April 14, 2022, 1:58pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/53 "2022-04-14T13:58:25Z")

</div>

Have done a basic list of all packages for CDN in the new draft docs as a suggestion and thoughts of adding CDN versions when available.  
Could add the basic page to the current docs if wanted.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 14, 2022, 2:38pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/54 "2022-04-14T14:38:36Z")

</div>

Would be much appreciated!

---

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [April 14, 2022, 4:45pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/56 "2022-04-14T16:45:35Z")

</div>

> [@MarianG](#):
>
> I don’t think it is ok to try workarouds like @Dad72 to get the babylonjs files.

Yes it’s not the ideal solution, but it works for my use case. This saves me having to download the zip file to take the scripts one by one and copy them into my projects. My solution makes things faster, without downloading and miscellaneous manipulation. I run the php file and all my projects are updated in 5 seconds locally. 😃

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [April 14, 2022, 7:08pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/57 "2022-04-14T19:08:11Z")

</div>

@RaananW had already submitted a PR for the page I was going to change.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 14, 2022, 8:15pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/58 "2022-04-14T20:15:23Z")

</div>

I merged it if you want to complete it ;D

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 14, 2022, 8:25pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/59 "2022-04-14T20:25:11Z")

</div>

I think we should list the cdn link for all the packages (like gui, babylon, loaders, etc…)

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [April 14, 2022, 8:57pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/60 "2022-04-14T20:57:51Z")

</div>

That is what I did. It will be tomorrow now before I do the PR.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 14, 2022, 9:04pm UTC](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483/61 "2022-04-14T21:04:48Z")

</div>

You rock as always

[Previous page](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483.md?page=2)

[Next page](https://forum.babylonjs.com/t/new-build-system-in-our-main-repository/28483.md?page=4)
