diff --git a/package.json b/package.json index cd19ea0..beeceff 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "contributors": [ "Daniel Swann (https://github.com/danswann)", "Longboyy", - "Helloman892" + "Helloman892", + "Sarah Klocke (https://sarahisweird.dev/)" ], "main": "index.js", "repository": { diff --git a/src/processScript/index.ts b/src/processScript/index.ts index 4038ea0..05abeea 100644 --- a/src/processScript/index.ts +++ b/src/processScript/index.ts @@ -26,7 +26,7 @@ import rollupPluginJSON from "@rollup/plugin-json" import rollupPluginNodeResolve from "@rollup/plugin-node-resolve" import type { LaxPartial } from "@samual/lib" import { assert } from "@samual/lib/assert" -import { relative as getRelativePath } from "path" +import { relative as getRelativePath, sep as pathSeparator, isAbsolute as isAbsolutePath } from "path" import prettier from "prettier" import { rollup } from "rollup" import { supportedExtensions as extensions } from "../constants" @@ -260,7 +260,7 @@ export async function processScript(code: string, { { name: `hackmud-script-manager`, async transform(code, id) { - if (id.startsWith(`/`) && !id.includes(`/node_modules/`)) + if (isAbsolutePath(id) && !id.includes(`${pathSeparator}node_modules${pathSeparator}`)) return (await preprocess(code, { uniqueId })).code let program!: NodePath