mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Dynamic URL in more places.
This commit is contained in:
1 parent
fb487ea622
commit
9a6058fedb
4 files changed
+21
-6
No files matched your search
@@ -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(),
|
||||
|
||||
Reference in new issue
Block a user