Skip to content

Template for javascript plugins using Babel for RPG Maker MZ

License

Notifications You must be signed in to change notification settings

comuns-rpgmaker/babel-plugin-archetype

Repository files navigation

RPG Maker MZ - Babel Plugin Archetype

This is a template repository for writing plugins for RPG Maker MZ using Babel. The main purpose here is to set a basis from which other repositories can derive from and more easily be ready to start actual development.

Getting Started

First of all, make sure you run npm install to install all the dependencies for the project, such as rollup.js and Babel itself.

Make sure to set package.json up correctly, changing the package name to that of your plugin (this will be used to generate the output file) and adjust the values of the version and description fields (and, optionally, keywords). Also make sure to add a property testProjectDir if you want to test your plugin (can be relative).

To configure plugin parameters and the likes, change plugin-metadata.yaml. Read more about it on comuns-rpgmaker/plugin-metadata.

Once you are done, npm run build will create a JS file for your plugin as dist/js/plugins/{pkg.name}.js.

By default, the plugin is wrapped into an IIFE and everything you export from ./src/main.js is saved under a namespace to be configured in package.json.

TL;DR:

First:

  • npm install
  • Modify package.json

Then:

  • Modify header.js and write modern JS code on src
  • npm run build
  • Your plugin shows up compiled in dist/js/plugins
  • Repeat

Guidelines

This repo's purpose is exclusively providing a basic structure for other plugin repos. It is not the place to create core functionality! (i.e. no application code here!)

Changes to this repo must not demand that repos derived from it be changed, but it should be possible to update them to a more recent version of the archetype fairly easily.