Native ES Modules in the Browser
Using ESM Without a Bundler
Modern browsers can load Babylon packages as native ES modules. An import map maps package specifiers such as @babylonjs/core or @babylonjs/lite to self-hosted files or a pinned npm CDN URL. Your application can then use standard import statements inside a <script type="module"> without bundling Babylon.js.
These complete demos show the same approach for both Babylon.js and Babylon Lite:
| Package | Live demos | Source |
|---|---|---|
| Babylon.js | Babylon.js native ESM in the browser | RaananW/babylonjs-esm-in-browser |
| Babylon Lite | Babylon Lite in the browser | RaananW/babylon-lite-in-browser |
The Babylon.js project runs one application against three module sources: self-hosted @babylonjs/core and @babylonjs/loaders package files, jsDelivr, and unpkg. It uses granular .pure.js imports so the unbundled browser does not fetch every re-export from a package barrel.
The Babylon Lite project includes a gallery of plain HTML and JavaScript scenes. It demonstrates both a local copy of the official @babylonjs/lite browser distribution and pinned jsDelivr or unpkg URLs. Babylon Lite is WebGPU-only, so its examples require a current browser with WebGPU support.
When to Use This Approach
Native browser ESM is useful for learning, prototypes, static pages, and environments where a bundling pipeline is undesirable. Keep these tradeoffs in mind:
- Browsers do not tree-shake modules. Use an ESM-aware bundler when minimizing the production payload is more important than avoiding a build step.
- Pin exact package versions when loading modules from an npm CDN.
- Prefer self-hosting when you need offline development, predictable caching and availability, or a strict Content Security Policy.
- Serve the files over HTTP or HTTPS instead of opening the HTML through a
file://URL.
The live demos expose their import maps and application source, and their GitHub repositories include the complete build and deployment configuration.
Further reading
Babylon.js ES6 support with Tree Shaking
Learn about tree shaking and package management in Babylon.js.

CDN Babylon.js Packages
Obtain BABYLON.js Packages via CDN.
