Skip to content

Commit cf2e950

Browse files
fix avoid node_modules dependency in dist build
1 parent 13fcdd4 commit cf2e950

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

build-dist.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,16 @@ try {
126126
console.log("✓ dist/molstar.css");
127127

128128
// 4. Generate TypeScript declarations
129-
// tsc is run via node directly to pass --stack-size, which is required because
130-
// molstar's type graph is deep enough to overflow node's default call stack.
129+
// --v8-flags=--stack-size=65536 is required because molstar's type graph is
130+
// deep enough to overflow V8's default call stack during declaration emit.
131131
console.log("Generating TypeScript declarations...");
132-
const tscPath = new URL("./node_modules/.bin/tsc", import.meta.url).pathname;
133-
const tscCmd = new Deno.Command("node", {
134-
args: ["--stack-size=65536", tscPath, "-p", "tsconfig.declarations.json"],
132+
const tscCmd = new Deno.Command("deno", {
133+
args: [
134+
"run", "--allow-all",
135+
"--v8-flags=--stack-size=65536",
136+
"npm:typescript/bin/tsc",
137+
"-p", "tsconfig.declarations.json",
138+
],
135139
stdout: "inherit",
136140
stderr: "inherit",
137141
});

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@molstar/molstar-components",
3-
"version": "0.6.0-experimental.10",
3+
"version": "0.6.0-experimental.11",
44
"license": "MIT",
55
"exports": "./dist/index.js",
66
"imports": {

0 commit comments

Comments
 (0)