Skip to content

Commit

Permalink
Fix scratchblocks path when part of larger npm tree (#1790)
Browse files Browse the repository at this point in the history
as in the desktop app
  • Loading branch information
GarboMuffin authored Dec 19, 2024
1 parent 5ba0cd9 commit 358fdf0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions development/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,9 @@ class Builder {
build.files[`/${extensionSlug}.html`] = file;
}

const scratchblocksPath = pathUtil.join(
__dirname,
"../node_modules/@turbowarp/scratchblocks/build/scratchblocks.min.js"
);
// Don't rely on node_modules being stored in a specific location or having a specific structure
// so that this works when we are a dependency in a bigger npm tree.
const scratchblocksPath = require.resolve("@turbowarp/scratchblocks");
build.files["/docs-internal/scratchblocks.js"] = new BuildFile(
scratchblocksPath
);
Expand Down

0 comments on commit 358fdf0

Please sign in to comment.