This is a boilerplate/template for Melvor Idle mods. Using TypeScript with Webpack, this will compile your mod to a single, uglified script file, largely reducing mod size and improving compatibilty with IDE features. The downside to this is it makes debugging in the browser a bit more difficult with the uglified source.
Requires Node.js
- Fork and clone repository.
- Run
npm install
- Update
package.json
'sname
property to match your mod. - Update
manifest.json
'snamespace
property. - Using the Creator Toolkit's Directory Link feature (Recommended)
- Run
npm run build
- Point the Directory Link to the created
dist
folder - Any further updates requires only a
npm run build
and a reload of the game
- Run
- Uploading to mod.io or using the Creator Toolkit's modfile feature:
- Run
npm run buildzip
- Upload the generated
.zip
file in thepackage
folder.
- Run
The official Melvor Idle Typing project definitions are included as part of this repository. You should have access to types/autocomplete with things like the modding context API or game
objects.
This repository automatically minifies and loads any HTML templates that are stored with a filename like *.template.html
. This allows for better separation of templates in the source files but reduces package size and speeds up load times.
- If you utilize this pattern you should not add any of your individual
*.template.html
files to the"load"
property of themanifest.json
file. - If you do not use any template files, remove the
templates.min.html
file from the"load"
property of themanifest.json
file.
- There are some oddities/type errors when referencing globally available 3rd party libraries like Swal ¯\_(ツ)_/¯
- Don't use
loadModule
to import modules. Use ES6import
instead. - Image files that you want to bundle with your mod must be in the
img
folder and be imported somewhere in the code. - The
img
folder cannot have subdirectories. - As mentioned above, the minification and uglification of code makes debugging error messages a bit more tedious.