function findProjectRoot() {
    let currentDir = process.cwd();

    // Check if we're already in ghost/core
    if (currentDir.endsWith('ghost/core') || currentDir.endsWith('ghost\\core')) {
        return currentDir;
    }

    // Look for ghost/core directory
    const ghostCorePath = path.join(currentDir, 'ghost', 'core');
    if (fs.existsSync(ghostCorePath)) {
        return ghostCorePath;
    }

    return currentDir;
}
Script to minify multiple JavaScript files using esbuild
Supports per-file configuration for bundling and other options

The tryghost/minifier package is not used because it is intended to be used at runtime,
allowing for replacements to be made on the fly (e.g. for card-assets and theme activation).

This script is intended to be run at build time, allowing for us to use the minified files
in the production build and be able to utilize bundler benefits.