
In order to use Rollup, we need to create a new file, set the task for the ROLLUP.If you're new to programming, or you're new to JavaScript, but you think Screeps is cool and you really want to play it, in this tutorial I'm going to show you the simplest Screeps code possible and I'm going to walk you through step-by-step what each line of code means, what it does, and how I got there. The plugin reads the account information from the current path Screeps.json and submits the configured file to the server, because Rollup packs multiple JS files compiled by the TSC into one main, so we don't need to configure it separately for each Module.

Screeps.json configuration can be referred to in 2.4 But this will be modified in the future, there is always trouble, so you can use the config configuration file to pass the parameters, you can see if we pass the config to the configuration file path, you will call LoadConfigfile to read the configuration file information, we can Add a UPLOADFILE attribute in the configuration file and use it here. If you submit it according to documentation, there will be as follows, always submit it, it has been stopped here.įollow the prompts, we open the index.js and rollup-screeps-plugin.js files under the Rollup-Plugin-Screeps \ Dist path in Node_Module, find the OnGenerate hook to GenerateBundle, and change OnWrite to WriteBundle.Īt this time, run will still report, because the plugin calls the UPLOADSOURCE function in the callback, and the option used in this function is not found in the current Rollup version, so we will report the Type Error, we have to do it very Simply, change Option.file directly to Main.js relative path, such as "./dist/main.js".


Rollup has ready-made Screeps script submission modules, such as rollup-plugin-screepsHowever, because this plugin is submitted by the author in 18 years, it seems that it is not compatible with the current version of Rollup. Npm install Configuration 2.1 Using the Screeps Plugin in ROLLUP
