(opts: Record<string, any>, key: string)
| 40 | * @returns {Object} |
| 41 | */ |
| 42 | export const normalizeJsonOpt = (opts: Record<string, any>, key: string) => { |
| 43 | let devServerOpt = opts[key] || {}; |
| 44 | |
| 45 | if (isString(devServerOpt)) { |
| 46 | try { |
| 47 | devServerOpt = JSON.parse(devServerOpt); |
| 48 | } catch (e) { |
| 49 | printError(`Error while parsing "${key}" option`); |
| 50 | printError(e); |
| 51 | devServerOpt = {} |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | return devServerOpt; |
| 56 | } |
| 57 | |
| 58 | export const buildWebpackArgs = (opts: Record<string, any>) => { |
| 59 | return { |
no test coverage detected