UNPKG

@roots/bud

Version:

Configurable, extensible build tools for modern single and multi-page web applications

16 lines (15 loc) 651 B
import { jsxs as _jsxs, jsx as _jsx } from "@roots/bud-support/jsx-runtime"; import figures from '@roots/bud-support/figures'; import { Box, Text } from '@roots/bud-support/ink'; import { Webpack } from '@roots/bud-support/webpack'; export const Validate = ({ config, }) => { if (!config) return null; try { Webpack.validate(config); return (_jsx(Box, { children: _jsxs(Text, { color: "green", children: [figures.tick, " webpack validated configuration"] }) })); } catch (error) { return (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["\u274C ", error?.message ?? error] }) })); } };