( config: OutputOptions, preserveModules: boolean, inputOptions: NormalizedInputOptions )
| 119 | } |
| 120 | |
| 121 | const getFile = ( |
| 122 | config: OutputOptions, |
| 123 | preserveModules: boolean, |
| 124 | inputOptions: NormalizedInputOptions |
| 125 | ): NormalizedOutputOptions['file'] => { |
| 126 | const { file } = config; |
| 127 | if (typeof file === 'string') { |
| 128 | if (preserveModules) { |
| 129 | return error( |
| 130 | logInvalidOption( |
| 131 | 'output.file', |
| 132 | URL_OUTPUT_DIR, |
| 133 | 'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option' |
| 134 | ) |
| 135 | ); |
| 136 | } |
| 137 | if (!Array.isArray(inputOptions.input)) |
| 138 | return error( |
| 139 | logInvalidOption( |
| 140 | 'output.file', |
| 141 | URL_OUTPUT_DIR, |
| 142 | 'you must set "output.dir" instead of "output.file" when providing named inputs' |
| 143 | ) |
| 144 | ); |
| 145 | } |
| 146 | return file; |
| 147 | }; |
| 148 | |
| 149 | const getFormat = (config: OutputOptions): NormalizedOutputOptions['format'] => { |
| 150 | const configFormat = config.format; |
no test coverage detected
searching dependent graphs…