* Create two deferred builds for esm and cjs. The one follows the other: * - 1. The code gets compiled to an optimized tree-shaken esm output * - 2. We take that output and compile it to an optimized cjs output * @param options the original build options * @returns if options = [a, b], we get [a
(options: BuildOptions[])
| 68 | * @returns if options = [a, b], we get [a-esm, a-cjs, b-esm, b-cjs] |
| 69 | */ |
| 70 | function createBuildOptions(options: BuildOptions[]) { |
| 71 | return flatten( |
| 72 | map(options, (options) => [ |
| 73 | // we defer it so that we don't trigger glob immediately |
| 74 | () => applyDefaults(options), |
| 75 | // ... here can go more steps |
| 76 | ]), |
| 77 | ) |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * We only want to trigger the glob search once we are ready, and that is when |
no test coverage detected