Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"contributors": [
"Daniel Swann (https://github.com/danswann)",
"Longboyy",
"Helloman892"
"Helloman892",
"Sarah Klocke (https://sarahisweird.dev/)"
],
"main": "index.js",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/processScript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<Program>
Expand Down
Loading