forked from matthisk/es6console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
28 lines (22 loc) · 710 Bytes
/
index.js
File metadata and controls
28 lines (22 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import Babel from './babel6';
import Babel5 from './babel5';
import Traceur from './traceur';
import TypeScript from './typescript';
import Regenerator from './regenerator';
import Prepack from './prepack';
export const DEFAULT_COMPILER = 'Babel (6)';
export function getCompiler(name) {
if (!compilers.hasOwnProperty(name)) {
throw new ReferenceError(`Unexpected compiler naem ${name} please pick one of ${Object.keys(compilers)}`);
}
return compilers[name];
}
const compilers = {
'Babel (6)': new Babel(),
'Babel (5)': new Babel5(),
'Traceur': new Traceur(),
'TypeScript': new TypeScript(),
'Regenerator': new Regenerator(),
'Prepack': new Prepack(),
};
export default compilers;