mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
- most were added in ff8895103c8466694e7d8eeb734f51d2850670d8, but these two were missed - this should now cover all **thrown** errors - they only get thrown in the `options` hook, which does not implement Rollup's `this.error` - all other errors are already auto-prefixed by RollupContext etc
12 lines
552 B
TypeScript
12 lines
552 B
TypeScript
import * as tsTypes from "typescript";
|
|
|
|
import { tsModule } from "./tsproxy";
|
|
|
|
export function checkTsConfig(parsedConfig: tsTypes.ParsedCommandLine): void
|
|
{
|
|
const module = parsedConfig.options.module!;
|
|
|
|
if (module !== tsModule.ModuleKind.ES2015 && module !== tsModule.ModuleKind.ES2020 && module !== tsModule.ModuleKind.ESNext)
|
|
throw new Error(`rpt2: Incompatible tsconfig option. Module resolves to '${tsModule.ModuleKind[module]}'. This is incompatible with Rollup, please use 'module: "ES2015"', 'module: "ES2020"', or 'module: "ESNext"'.`);
|
|
}
|