Build & Bundlers
To get started, first install Excalibur through npm (TypeScript typings are best supported in npm):
bashnpm install excalibur
bashnpm install excalibur
TypeScript Configuration
In a TypeScript (or modern JavaScript) project, you can reference Excalibur with the ES6 import style syntax:
js// Excalibur is loaded into the ex global namespaceimport * as ex from 'excalibur';
js// Excalibur is loaded into the ex global namespaceimport * as ex from 'excalibur';
or
js// Excalibur is loaded into the ex global namespaceimport { Actor, Engine } from 'excalibur';
js// Excalibur is loaded into the ex global namespaceimport { Actor, Engine } from 'excalibur';
To support tree-shaking, you should use named imports:
jsimport { Actor } from 'excalibur';
jsimport { Actor } from 'excalibur';
warning
Excalibur's tree-shaking optimization is not fully optimized yet--likely you'll end up importing everything at the moment, but this is slowly getting better.