forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsx
More file actions
executable file
·28 lines (26 loc) · 724 Bytes
/
jsx
File metadata and controls
executable file
·28 lines (26 loc) · 724 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
#!/usr/bin/env node
// -*- mode: js -*-
"use strict";
var transform = require('../main').transform;
require('commoner').version(
require('../package.json').version
).resolve(function(id) {
return this.readModuleP(id);
}).option(
'--harmony',
'Turns on JS transformations such as ES6 Classes etc.'
).option(
'--strip-types',
'Strips out type annotations.'
).option(
'--source-map-inline',
'Embed inline sourcemap in transformed source'
).process(function(id, source) {
// This is where JSX, ES6, etc. desugaring happens.
var options = {
harmony: this.options.harmony,
sourceMap: this.options.sourceMapInline,
stripTypes: this.options.stripTypes
};
return transform(source, options);
});