// Check if the renderer and main bundles are built import path from 'path'; import chalk from 'chalk'; import fs from 'fs'; import webpackPaths from '../configs/webpack.paths'; const mainPath = path.join(webpackPaths.distMainPath, 'main.js'); const rendererIndexPath = path.join( webpackPaths.distRendererPath, 'renderer-index.js', ); const rendererEnforcerPath = path.join( webpackPaths.distRendererPath, 'renderer-enforcer.js', ); if (!fs.existsSync(mainPath)) { throw new Error( chalk.whiteBright.bgRed.bold( 'The main process is not built yet. Build it by running "npm run build:main"', ), ); } if (!fs.existsSync(rendererIndexPath) || !fs.existsSync(rendererEnforcerPath)) { throw new Error( chalk.whiteBright.bgRed.bold( 'The renderer process is not built yet. Build it by running "npm run build:renderer"', ), ); }