Skip to main content

Building Apps

This article discusses considerations in building and deploying applications that contain

Package Format

Starting from v9.0, is fully ES module compliant with support for both ESM-style import and CommonJS-style require().

When installed from npm, each submodule provides the following entry points:

dist/index.jsESM (import)Code is only lightly transpiled to target ES2020. Tree-shakable.
dist/index.cjsCommonJS (require)Code is bundled without dependencies, and transpiled to target Node16. Not tree-shakable.
dist.min.jsUMD (script tag)Code is bundled with dependencies, and transpiled to target ['chrome110', 'firefox110', 'safari15'] then minified.
dist/ (script tag)Same as above, but not minified.

Although the packages are designed to work with the widest range of use cases, it's going to be much easier if you work with an up-to-date development framework.

Known issues

  • Some older bundlers may not support the latest syntax featuers (e.g. Webpack 4 does not recognize optional chaining). You need to use a Babel plugin and tell it to include node_modules with @babel/preset-ev.
  • Frameworks such as Next.js and Gatsby leverage Server Side Rendering to improve page loading performance. For projects that do not use type: "module" in their package.json, SSR may fail with an error message Error: require() of ES Module 'xxx'. This is because some of's upstream dependencies, such as d3, have opted to become ESM-only and no longer support require(). See possible solutions.
  • Although enormous efforts have been put into converting the and its upstream libraries' code base into TypeScript, some part of the legacy code paths may not meet strict type requirements, such as noImplicitAny and strictNullChecks. You may need to set skipLibCheck: true in your project's tsconfig to unblock compilation.

Bundle Size provides a lot of functionality and the amount of code these libraries contain will unsurprisingly impact the size of your application bundle and your startup load time. is designed from the ground up to be highly extensible. Visualization types are supported by different layers; additional layer features can be added by layer extensions; more data formats can be supported by submodules. The core is fairly lean, and each functionality is self-contained, so that applications do not have to bundle things that they don't need. Because modern build tools support tree shaking, most new features added do not have a visible size impact on existing applications. maintainers are conscious about how design decisions and code changes impact bundle size. The test harness has a script that evaluates the size of a minified bundle after each build. The following numbers are offered for your reference.

ImportsBundle sizeCompressedComments
Deck + Layer501.2 kb145.3 kbMinimal core; baseline
DeckGL (React)10.9 kb3.84 kb
HexagonLayer39.1 kb11.3 kb
GeoJsonLayer97.9 kb27.7 kbIncludes the most commonly used primitive layers:
ScatterplotLayer, IconLayer, TextLayer, PathLayer, PolygonLayer
MVTLayer180.9 kb52.6 kbGeoJsonLayer + TileLayer + MVT loader
Tile3DLayer253.9 kb75.1 kbScenegraphLayer + SimpleMeshLayer + GLTF loader + 3D tiles loader
  • Numbers measured using v9.0.1
  • Bundled and minified by esbuild targeting evergreen browsers.
  • All rows after the first are incremental impact on top of the minimal core
  • Compressed bundle sizes are calculated using gzip -9. Consider using slower brotli compression for static assets, it typically provides an additional 20% reduction.