-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.js
45 lines (42 loc) · 958 Bytes
/
index.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
// const path = require('path')
// const fs = require('fs')
// const isUseTypescript = fs.existsSync(path.join(process.env.MEGALO_CLI_CONTEXT, 'tsconfig.json'))
module.exports = function () {
// TODO 根据platform,分别输出真对小程序和h5的配置
const presets = [
['@babel/preset-env', {
'targets': {
'browsers': [
'Android >= 4',
'iOS >= 10'
]
}
}]
]
const plugins = [
[
'@babel/plugin-transform-runtime',
{
'helpers': false,
'regenerator': true
}
],
[
'@babel/plugin-proposal-decorators',
{ 'legacy': true }
],
['@babel/plugin-proposal-class-properties',
{ 'loose': true }
]
]
// if (isUseTypescript) {
// // 暂时用ts-loader 来替换
// presets.push(['@babel/preset-typescript', { allExtensions: true }])
// plugins.push(
// )
// }
return {
presets,
plugins
}
}