Skip to content

Modern Bundlers and ESM

The original documentation described ES2015 projects through Webpack and Browserify. The current package keeps compatibility with that style, but the preferred workflow is Vite plus the package exports.

Modern projects can import the framework directly:

import * as xjs from '@splitmedialabs/xjs';
await xjs.ready();
const scene = await xjs.Scene.getActiveScene();
const items = await scene.getItems();

CommonJS consumers can require the package entry:

const xjs = require('@splitmedialabs/xjs');
xjs.ready()
.then(xjs.Scene.getActiveScene)
.then((scene) => scene.getItems());

Pages that load the browser bundle from HTML should use the historical loader name:

<script src="js/xjs.js"></script>
<script src="js/main.js"></script>
const xjs = require('xjs');

The browser bundle and XSplit harness are built for CEF 103 compatibility. The modern ESM package output is intended for current tooling and does not replace the CEF-targeted browser bundle for host-loaded pages.