Skip to content

Mappings

moonlight uses mappings that automatically rename Webpack modules for you.

Notable modules

  • react: React
  • discord/packages/flux: Discord’s fork of Flux
  • discord/Dispatcher: Discord’s Flux dispatcher
  • discord/components/common/index: A lot of components reused in the client

Using mappings in an extension

You can import and require mappings like any other module:

import Dispatcher from "@moonlight-mod/wp/discord/Dispatcher";
// or
const Dispatcher = require("discord/Dispatcher").default;

Remember to add the module as a dependency.