// Copy node icons next to their compiled .node.js files. n8n loads the icon // from a path relative to the node file in dist/, so the SVG must travel along. import { cp, mkdir } from 'node:fs/promises'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; const root = dirname(dirname(fileURLToPath(import.meta.url))); const assets = [ ['nodes/BrowserCli/browserCli.svg', 'dist/nodes/BrowserCli/browserCli.svg'], ]; for (const [from, to] of assets) { await mkdir(dirname(join(root, to)), { recursive: true }); await cp(join(root, from), join(root, to)); console.log(`copied ${from} -> ${to}`); }