MCPcopy Create free account
hub / github.com/wonderwhy-er/DesktopCommanderMCP / buildTarget

Function buildTarget

scripts/build-ui-runtime.cjs:49–78  ·  view source on GitHub ↗
(targetName)

Source from the content-addressed store, hash-verified

47}
48
49async function buildTarget(targetName) {
50 const { entry, output, staticDir, styleLayers } = TARGETS[targetName];
51 const outputPath = path.join(projectRoot, output);
52 const outputDir = path.dirname(outputPath);
53
54 await fs.mkdir(outputDir, { recursive: true });
55
56 for (const fileName of STATIC_FILES) {
57 await fs.copyFile(
58 path.join(projectRoot, staticDir, fileName),
59 path.join(outputDir, fileName)
60 );
61 }
62
63 const styles = await Promise.all(
64 styleLayers.map((layerPath) => fs.readFile(path.join(projectRoot, layerPath), 'utf8'))
65 );
66 await fs.writeFile(path.join(outputDir, 'styles.css'), `${styles.join('\n\n')}\n`, 'utf8');
67
68 await build({
69 entryPoints: [path.join(projectRoot, entry)],
70 bundle: true,
71 format: 'iife',
72 platform: 'browser',
73 target: ['es2020'],
74 outfile: outputPath,
75 minify: true,
76 sourcemap: false
77 });
78}
79
80async function main() {
81 for (const targetName of selectedTargets) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected