UNPKG

693 BPlain TextView Raw
1import { tsModule } from "./tsproxy";
2import * as tsTypes from "typescript";
3
4export function checkTsConfig(parsedConfig: tsTypes.ParsedCommandLine): void
5{
6 const module = parsedConfig.options.module;
7
8 switch (module)
9 {
10 case tsModule.ModuleKind.ES2015:
11 case tsModule.ModuleKind.ESNext:
12 break;
13 case undefined:
14 throw new Error(`Incompatible tsconfig option. Missing module option. This is incompatible with rollup, please use 'module: "ES2015"' or 'module: "ESNext"'.`);
15 default:
16 throw new Error(`Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with rollup, please use 'module: "ES2015"' or 'module: "ESNext"'.`);
17 }
18}