(
args: string[],
existingOptions: api.CompilerOptions = {},
ngCmdLineOptions: string[] = [],
)
| 143 | } |
| 144 | |
| 145 | export function readCommandLineAndConfiguration( |
| 146 | args: string[], |
| 147 | existingOptions: api.CompilerOptions = {}, |
| 148 | ngCmdLineOptions: string[] = [], |
| 149 | ): ParsedConfiguration { |
| 150 | let cmdConfig = ts.parseCommandLine(args); |
| 151 | const project = cmdConfig.options.project || '.'; |
| 152 | const cmdErrors = cmdConfig.errors.filter((e) => { |
| 153 | if (typeof e.messageText === 'string') { |
| 154 | const msg = e.messageText; |
| 155 | return !ngCmdLineOptions.some((o) => msg.indexOf(o) >= 0); |
| 156 | } |
| 157 | return true; |
| 158 | }); |
| 159 | if (cmdErrors.length) { |
| 160 | return { |
| 161 | project, |
| 162 | rootNames: [], |
| 163 | options: cmdConfig.options, |
| 164 | errors: cmdErrors, |
| 165 | emitFlags: api.EmitFlags.Default, |
| 166 | }; |
| 167 | } |
| 168 | const config = readConfiguration(project, cmdConfig.options); |
| 169 | const options = {...config.options, ...existingOptions}; |
| 170 | if (options.locale) { |
| 171 | options.i18nInLocale = options.locale; |
| 172 | } |
| 173 | return { |
| 174 | project, |
| 175 | rootNames: config.rootNames, |
| 176 | options, |
| 177 | errors: config.errors, |
| 178 | emitFlags: config.emitFlags, |
| 179 | }; |
| 180 | } |
| 181 | |
| 182 | function getFormatDiagnosticsHost(options?: api.CompilerOptions): ts.FormatDiagnosticsHost { |
| 183 | const basePath = options ? options.basePath : undefined; |
no test coverage detected
searching dependent graphs…