{"id":22215,"library":"rollup-plugin-screeps","title":"rollup-plugin-screeps","description":"Rollup plugin for uploading compiled code to the Screeps MMO/private servers. Integrates directly into the Rollup build pipeline, reading credentials and server configuration from a screeps.json file. Supports automatic branch naming based on git branch, maps source files to screeps modules, and optionally uploads source maps. Current version 1.0.1 is stable with low release cadence. Alternative to grunt-screeps for projects using Rollup as bundler.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/Arcath/rollup-plugin-screeps","tags":["javascript","rollup","screeps"],"install":[{"cmd":"npm install rollup-plugin-screeps","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-screeps","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-screeps","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required as the plugin host","package":"rollup","optional":false}],"imports":[{"note":"ESM-only package; does not support CommonJS require.","wrong":"const screeps = require('rollup-plugin-screeps')","symbol":"default","correct":"import screeps from 'rollup-plugin-screeps'"},{"note":"Named export not available; use default import. The named import pattern is a common mistake.","wrong":"import { rollupPluginScreeps } from 'rollup-plugin-screeps'","symbol":"screeps","correct":"import { screeps } from 'rollup-plugin-screeps'"},{"note":"TypeScript users can import the options type for typed configs.","symbol":"ScreepsPluginOptions","correct":"import type { ScreepsPluginOptions } from 'rollup-plugin-screeps'"}],"quickstart":{"code":"// rollup.config.js\nimport screeps from 'rollup-plugin-screeps';\n\nexport default {\n  input: 'src/main.js',\n  output: {\n    dir: 'dist',\n    format: 'esm',\n    sourcemap: true\n  },\n  plugins: [\n    screeps({\n      configFile: './screeps.json',\n      dryRun: false\n    })\n  ]\n};","lang":"javascript","description":"Configures rollup-plugin-screeps to upload compiled output to Screeps using credentials from screeps.json, with source maps enabled."},"warnings":[{"fix":"Verify the configFile path is relative to the rollup config and the JSON is valid with all required fields: email, password, protocol, hostname, port, path, branch.","message":"Plugin will fail silently if configFile path is wrong or screeps.json is malformed.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use import syntax instead of require(). Update your rollup config to ESM.","message":"Version 1.0.0 dropped support for CommonJS. The package is now ESM-only.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Switch to dynamic import() or use a CommonJS wrapper like import().default.","message":"Using require() will throw a runtime error in Node.js without ESM support.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Set sourcemap: true in the output configuration of rollup.config.js.","message":"If sourcemap is not true in rollup output, the plugin will not generate or upload source maps even if configured.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Explicitly set branch string in screeps.json if git is not guaranteed available.","message":"Setting branch to 'auto' depends on git being installed and available in the build environment; otherwise fails.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev rollup-plugin-screeps in the project directory.","cause":"Package not installed or installed globally but not in local node_modules.","error":"Error: Cannot find module 'rollup-plugin-screeps'"},{"fix":"Change to import screeps from 'rollup-plugin-screeps' and ensure rollup.config.js uses .mjs extension or nearest package.json has \"type\": \"module\".","cause":"Using require() with ESM-only package.","error":"TypeError: screeps is not a function"},{"fix":"Double-check the path relative to where rollup is invoked. Use absolute path or ensure screeps.json is in the same directory as rollup.config.js.","cause":"The configFile path is incorrect or the file does not exist.","error":"Error: Config file not found at ./screeps.json"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}