silki
Version:
Cli tool for build react app, based on generator-react-multipage, create-react-app, roadhog. Support react multiple pages app develop.
16 lines (13 loc) • 404 B
JavaScript
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 {};
}