Add ModuleType `none`
This commit is contained in:
parent
0f9c200583
commit
939004264a
|
@ -28,7 +28,7 @@ export function stripShebang(items: Items): Items {
|
|||
return items;
|
||||
}
|
||||
|
||||
export type ModuleType ='es6' | 'require' | 'global';
|
||||
export type ModuleType ='es6' | 'require' | 'global' | 'none';
|
||||
|
||||
export type ErrorSink = (message: string, start: Pos | undefined, end: Pos | undefined) => void;
|
||||
|
||||
|
@ -37,7 +37,6 @@ export interface CompileOptions {
|
|||
name?: string,
|
||||
runtime?: string,
|
||||
module?: ModuleType,
|
||||
global?: string,
|
||||
typescript?: boolean,
|
||||
emitError: ErrorSink,
|
||||
}
|
||||
|
@ -331,6 +330,12 @@ export function compile(options: CompileOptions): CompilerOutput {
|
|||
case 'global':
|
||||
tree = ts`const __SYNDICATE__ = ${runtime};\n${tree}`;
|
||||
break;
|
||||
case 'none':
|
||||
break;
|
||||
default:
|
||||
((_: never) => {
|
||||
throw new Error(`Unsupported ModuleType: ${moduleType}`);
|
||||
})(moduleType);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue