Skip to content

Inline Static Assets in Builds #10619

Open
@ggetz

Description

@ggetz

The current CesiumJS distribution consists of a single, bundled JS entry point, Cesium.js, which inlines all library JS code. It also ships with several other static files, including standalone Worker JS files, third party wasm files, JSON data, images/textures, and CSS files. Depending on what features of the library is being used, some or all of these static files are required to be loaded at runtime.

While we've operated with these static files as part of the distribution since the beginning, it can require extra infrastructure on the part of developers depending on CesiumJS. We'd like to re-evaluate our strategy and look into providing a single-file CesiumJS distribution

As a first step, we could allow an optional inline flag as part of the build script. esbuild has a loader option which allows other file types besides JS to be inlined most likely as data urls.

After ensuring everything works, we should put some thought into potentially shipping by default as part of the release zip.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions