UNPKG

roadhogx

Version:

Cli tool for serve and build react app, based on roadhog, support JSON pattern config, support more features

16 lines (13 loc) 404 B
import { resolve } from 'path'; export default function getTheme(cwd = process.cwd(), { theme }) { if (theme) { if (typeof theme === 'string') { const themeFile = resolve(cwd, theme); const themeConfig = require(themeFile); // eslint-disable-line return typeof themeConfig === 'function' ? themeConfig() : themeConfig; } else { return theme; } } return {}; }