BUGFIX: fix relative imports (#1305)

Relative paths work in imports, at last.
This commit is contained in:
Caldwell
2024-06-03 02:38:01 +02:00
committed by GitHub
parent 76ce2f9955
commit f40d4f8e92
7 changed files with 219 additions and 51 deletions
+7 -1
View File
@@ -73,7 +73,13 @@ export class Script implements ContentFile {
* @param {Script[]} otherScripts - Other scripts on the server. Used to process imports
*/
updateRamUsage(otherScripts: Map<ScriptFilePath, Script>): void {
const ramCalc = calculateRamUsage(this.code, otherScripts, this.filename.endsWith(".script"));
const ramCalc = calculateRamUsage(
this.code,
this.filename,
otherScripts,
this.server,
this.filename.endsWith(".script"),
);
if (ramCalc.cost && ramCalc.cost >= RamCostConstants.Base) {
this.ramUsage = roundToTwo(ramCalc.cost);
this.ramUsageEntries = ramCalc.entries as RamUsageEntry[];