Build System

Estimated reading time: less than 1 minute

This page gives an overview of ModLoader’s build flow. For Mod creation only, see Packaging. The content here targets ModLoader contributors and users building custom game bundles.

Quick Navigation

  • Insert Tools — insert2html, packModZip, sc2ReplaceTool, sc2PatchTool usage, options, and examples
  • CI/CD Pipeline — GitHub Actions flow and per-repo build artifacts
  • Custom SC2 Engine — Engine changes and how to replace it without full recompile

Building ModLoader

yarn run webpack:BeforeSC2
yarn run ts:ForSC2
yarn run webpack:insertTools

Outputs:

  • dist-BeforeSC2/BeforeSC2.js — ModLoader core
  • dist-insertTools/insert2html.js — HTML injection tool
  • dist-insertTools/packModZip.js — Mod packaging tool
  • dist-insertTools/sc2ReplaceTool.js — SC2 engine replacement tool

See Insert Tools.

Full Packing Overview

  1. Build modified SC2 engine — Run node build.js -d -u -b 2 in sugarcube-2_Vrelnir to produce format.js
  2. Replace game engine — Override devTools/tweego/storyFormats/sugarcube-2/format.js in the game project with format.js, or use sc2ReplaceTool on compiled HTML
  3. Inject ModLoader — Use insert2html to inject ModLoader into the game HTML and embed Mods from modList.json