(options)
| 24 | } |
| 25 | |
| 26 | export function getMainFields(options) { |
| 27 | let mainFields; |
| 28 | if (options.mainFields) { |
| 29 | ({ mainFields } = options); |
| 30 | } else { |
| 31 | mainFields = ['module', 'main']; |
| 32 | } |
| 33 | if (options.browser && mainFields.indexOf('browser') === -1) { |
| 34 | return ['browser'].concat(mainFields); |
| 35 | } |
| 36 | if (!mainFields.length) { |
| 37 | throw new Error('Please ensure at least one `mainFields` value is specified'); |
| 38 | } |
| 39 | return mainFields; |
| 40 | } |
| 41 | |
| 42 | export function getPackageInfo(options) { |
| 43 | const { |