Rollup Plugin Screeps SS3

raw JSON →
1.1.2 verified Mon Apr 27 auth: no javascript

A Rollup plugin for uploading code to Screeps game servers. Version 1.1.2 supports the unified `.screeps.yaml` credentials file (SS3 standard) as well as legacy JSON config. It automatically applies source maps in Screeps-friendly format and can derive the target branch from the current git branch. Unlike other Screeps plugins, it integrates with the Screepers unified credential standard and offers environment variable overrides for server and branch.

error Error: Cannot find module 'rollup-plugin-screeps-ss3'
cause Package not installed or not in devDependencies
fix
npm install --save-dev rollup-plugin-screeps-ss3
error TypeError: screeps is not a function
cause Using incorrect import pattern: named import instead of default import
fix
import screeps from 'rollup-plugin-screeps-ss3'
error Error: Config file not found: .screeps.yaml
cause Missing or misnamed credentials file in project root
fix
Create a .screeps.yaml file following the SS3 standard, or pass explicit config object
error TypeError: Cannot read property 'default' of undefined
cause Using CommonJS require without accessing .default
fix
const screeps = require('rollup-plugin-screeps-ss3').default;
gotcha Source maps only work if output format is 'cjs' or 'es' with inline source maps
fix Set output.format to 'cjs' or 'es' and enable sourcemap: true
deprecated Legacy JSON config file is deprecated in favor of .screeps.yaml
fix Migrate your config to .screeps.yaml following the SS3 unified credentials standard
breaking The package no longer exports a named function, only default export
fix Use import screeps from ... instead of import { screeps } from ...
gotcha If branch is set to 'auto' and not in a git repository, the plugin will throw
fix Ensure you are in a git repository when using branch: 'auto', or set an explicit branch name
npm install rollup-plugin-screeps-ss3
yarn add rollup-plugin-screeps-ss3
pnpm add rollup-plugin-screeps-ss3

Example rollup.config.js using the plugin with environment variable overrides for server and branch and source maps enabled.

// rollup.config.js
import screeps from 'rollup-plugin-screeps-ss3';

export default {
  input: 'src/main.js',
  output: {
    file: 'dist/main.js',
    format: 'cjs',
  },
  sourcemap: true,
  plugins: [
    screeps({
      server: process.env.SCREEPS_SERVER ?? 'main',
      branch: process.env.SCREEPS_BRANCH ?? 'auto',
    })
  ]
};