From 68e11605cbc780a7e09d18af76c1019c4ef3aabf Mon Sep 17 00:00:00 2001 From: "Clarence \"Sparr\" Risher" Date: Thu, 13 Nov 2025 19:15:48 -0500 Subject: [PATCH] Fix rollup errors --- package.json | 1 + rollup.config.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f6837da92..a2d9f92ef 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "screeps-typescript-starter", + "type": "module", "version": "3.0.0", "description": "", "main": "index.js", diff --git a/rollup.config.js b/rollup.config.js index 70da24d20..b93b61a62 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -10,8 +10,12 @@ let cfg; const dest = process.env.DEST; if (!dest) { console.log("No destination specified - code will be compiled but not uploaded"); -} else if ((cfg = require("./screeps.json")[dest]) == null) { - throw new Error("Invalid upload destination"); +} else { + const screepsData = await import( "./screeps.json", { with: { type: "json" } } ); + cfg = screepsData.default[dest]; + if (cfg == null) { + throw new Error("Invalid upload destination"); + } } export default {