forked from edtr-io/edtr-io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
32 lines (32 loc) · 898 Bytes
/
babel.config.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
/* eslint-disable import/no-commonjs */
module.exports = function(api) {
return {
presets: [
'@babel/preset-env',
'@babel/preset-react',
'@babel/preset-typescript'
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-transform-runtime',
...(api.env(['development', 'test'])
? [
[
'babel-plugin-module-resolver',
{
alias: {
'^@edtr-io/([^/]+)(.*)': ([_, packageName, filePath]) => {
const base = `@edtr-io/${packageName}`
if (filePath.startsWith('/__fixtures__'))
return `${base}${filePath}`
return `${base}/src${filePath}`
}
},
loglevel: 'silent'
}
]
]
: [])
]
}
}