Comment on page
The starter kit builds your code using
rollup, which uses a
screeps.jsonfile we built on the previous section as its configuration file.
screeps.jsonfile is a JSON configuration file separated into multiple environments. We're going to focus on the
mainenvironment to get you started. If you'd like to deploy to a different branch, be sure to change the
branchkey to the branch you'd like to deploy to.
You don't have to manually create the target branch in your Screeps client if it doesn't exist yet.
rollup-plugin-screepswill do it for you.
Once you're done, run the following command:
npm run push-main
You're done! Now go to your Screeps client and make sure your code is deployed properly.
Screeps also lets you run your own private server. This can be a great way to test your code in a safe environment, and you can add mods that allow you to customize your server as well, such as drastically increasing the tickrate.
To deploy to a private server, run the following command:
npm run push-pserver
If you are having trouble pushing your code, make sure to check your
"pserver"the json properties are a little confusing:
"email"should actually contain the username of your account on the private server you are trying to connect to, which may be different from your account on the official Screeps shards!
"hostname"is the IP address of the server. If you are hosting your own server locally, the default localhost IP for most networks is