Dynamic URL in more places.

This commit is contained in:
Chad Curtis committed 2025-10-08 03:55:10 +00:00
1 parent fb487ea622
commit 9a6058fedb
4 files changed
+21 -6

No files matched your search

+5 -2
View File
@@ -1,23 +1,26 @@
import type { Tool } from "./Tool";
import type { JSRuntimeFS } from "../JSRuntime";
import type { AppConfig } from "../../contexts/AppContext";
import { buildProject } from "../build";
export class BuildProjectTool implements Tool<void> {
private fs: JSRuntimeFS;
private cwd: string;
private config: AppConfig;
readonly description = "Build the project using esbuild. Creates optimized production files in the dist directory.";
constructor(fs: JSRuntimeFS, cwd: string) {
constructor(fs: JSRuntimeFS, cwd: string, config: AppConfig) {
this.fs = fs;
this.cwd = cwd;
this.config = config;
}
async execute(): Promise<string> {
try {
// Build and write the project files
const result = await buildProject({
esmUrl: 'https://esm.shakespeare.diy',
esmUrl: this.config.esmUrl,
fs: this.fs,
projectPath: this.cwd,
domParser: new DOMParser(),