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'snameproperty to match your mod. - Update
manifest.json'snamespaceproperty. - Using the Creator Toolkit's Directory Link feature (Recommended)
- Run
npm run build - Point the Directory Link to the created
distfolder - Any further updates requires only a
npm run buildand 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
.zipfile in thepackagefolder.
- 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.htmlfiles to the"load"property of themanifest.jsonfile. - If you do not use any template files, remove the
templates.min.htmlfile from the"load"property of themanifest.jsonfile.
- There are some oddities/type errors when referencing globally available 3rd party libraries like Swal ¯\_(ツ)_/¯
- Don't use
loadModuleto import modules. Use ES6importinstead. - Image files that you want to bundle with your mod must be in the
imgfolder and be imported somewhere in the code. - The
imgfolder cannot have subdirectories. - As mentioned above, the minification and uglification of code makes debugging error messages a bit more tedious.