This is a sample extension for the moonlight Discord mod.
- Make sure you have Node.js and pnpm installed.
- Click "Use this template".
- In the repository settings, make sure GitHub Actions are enabled for this repository, and that the GitHub Pages source is set to GitHub Actions.
Then, clone and start hacking away:
- Install dependencies (
pnpm i
). - Build the project (
pnpm run build
).- If you'd prefer to run in watch mode, do
pnpm run dev
instead.
- If you'd prefer to run in watch mode, do
Add the following to your moonlight config:
{
"devSearchPaths": [
"/path/to/sample-extension/dist"
]
}
where /path/to/sample-extension
is the folder you cloned the repository into. After restarting your client, the extension will load.
This sample extension uses esbuild as its build system. The two entrypoints (index
and node
) get loaded on the web and Node.js side respectively. Code exported from the Node.js side can be called from the web side. Each side is optional, in case you only need to run in a specific context (usually web only).
Your repository will be published to https://<username>.github.io/<repository>/repo.json
. Every time a commit is made to the main branch, the extensions will be built on GitHub Actions and published automatically.