-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
babel-options.js
53 lines (48 loc) · 1.21 KB
/
babel-options.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
var path = require('path');
var paths = require('./paths');
exports.base = function() {
return {
filename: '',
filenameRelative: '',
sourceMap: true,
sourceRoot: '',
moduleRoot: path.resolve('src').replace(/\\/g, '/'),
moduleIds: false,
comments: false,
compact: false,
code:true,
presets: [ 'es2015-loose', 'stage-1'],
plugins: [
'syntax-flow',
'transform-decorators-legacy',
['babel-dts-generator', {
packageName: paths.packageName,
typings: '',
suppressModulePath: true,
suppressComments: false,
memberOutputFilter: /^_.*/
}],
'transform-flow-strip-types'
]
};
}
exports.commonjs = function() {
var options = exports.base();
options.plugins.push('transform-es2015-modules-commonjs');
return options;
};
exports.amd = function() {
var options = exports.base();
options.plugins.push('transform-es2015-modules-amd');
return options;
};
exports.system = function() {
var options = exports.base();
options.plugins.push('transform-es2015-modules-systemjs');
return options;
};
exports.es2015 = function() {
var options = exports.base();
options.presets = ['stage-1']
return options;
};