npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cesium-webpack-plugin

v1.1.0

Published

CesiumJS plugin for webpack

Readme

cesium-webpack-plugin

Let's use 🌍Cesium with webpack today! Resium is also recommended.

Very very easy usage

1. Install modules

npm install --save-dev cesium-webpack-plugin
npm install --save cesium resium
# or
yarn add -D cesium-webpack-plugin
yarn add cesium resium

2. Add plugin to webpack.config.js

const CesiumWebpackPlugin = require("cesium-webpack-plugin");

module.exports = {
  // ...
  plugins: [
    // ...
    new CesiumWebpackPlugin(),
  ],
};

3. Congratulations

Set up is complete! Enjoy your Cesium life.

You can import Cesium as following:

import { Viewer, Entity, Color } from "cesium";

If you are using Resium, you can import Cesium and Resium as following.

import { Color } from "cesium";
import { Viewer, Entity } from "resium";

Options

If the option is omitted, the default options is used:

new CesiumWebpackPlugin({
  loadPartially: false,
  loadCSSinHTML: true,
  cesiumPath: "cesium",
});

loadPartially

If false, whole Cesium will be loaded in HTML and window.Cesium is used in import { ... } from "cesium";. This is the easiest way.

Otherwise, Cesium will be load partially and bundled in the JS. You have to install strip-pragma-loader to build Cesium for production: npm i -D strip-pragma-loader.

For more details, refer to Cesium official tutorial.

loadCSSinHTML

If true, Widgets/widgets.css in Cesium is loaded in HTML.

Otherwise, you have to load the CSS once manually as following.

If loadPartially is true:

import "cesium/Widgets/widgets.css";

Otherwise:

import "cesium/Build/CesiumUnminified/Widgets/widgets.css";

cesiumPath

Directory path destination to copy Cesium files. Also used as the URL prefix for CESIUM_BASE_URL and any injected tag src.

outputPath

Absolute filesystem directory to copy assets into, overriding the default (relative to webpack's output.path). Only needed when output.path isn't the actual served static root — see the Next.js section below.

Next.js (App Router)

There's no index.html for webpack to inject tags into and no global window.Cesium script — Next.js bundles cesium like any other dependency instead, and only files under public/ are served as static assets. This plugin detects the missing html-webpack-plugin and adapts automatically: it skips tag injection/externals and just bundles cesium normally.

next.config.js:

const path = require("path");
const CesiumWebpackPlugin = require("cesium-webpack-plugin");

module.exports = {
  webpack(config) {
    config.plugins.push(
      new CesiumWebpackPlugin({
        cesiumPath: "/cesium",
        outputPath: path.join(__dirname, "public", "cesium"),
      })
    );
    return config;
  },
};

Import the widgets CSS once yourself (there's no HTML <head> to inject it into):

import "cesium/Build/Cesium/Widgets/widgets.css";

CESIUM_BASE_URL is set via DefinePlugin, which only takes effect for code webpack actually bundles from cesium's ES source (its package.json module/exports fields already point there on modern Cesium versions — no resolve.alias needed). Client components that import cesium before this runs should still work: the free CESIUM_BASE_URL identifier is compiled in at build time, not read at runtime.