mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
19 lines
647 B
JavaScript
Executable File
19 lines
647 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
import { existsSync } from 'node:fs';
|
|
import { dirname, resolve } from 'node:path';
|
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
|
const entryDir = dirname(fileURLToPath(import.meta.url));
|
|
const distEntry = resolve(entryDir, '../dist/index.mjs');
|
|
const requiredDistEntries = [distEntry];
|
|
const missingDistEntries = requiredDistEntries.filter((entry) => !existsSync(entry));
|
|
|
|
if (missingDistEntries.length > 0) {
|
|
throw new Error(
|
|
`tools-dev dist entries not found: ${missingDistEntries.join(', ')}. Run "pnpm --filter @open-design/tools-dev build" first.`,
|
|
);
|
|
}
|
|
|
|
await import(pathToFileURL(distEntry).href);
|