-
Notifications
You must be signed in to change notification settings - Fork 15
/
babel.config.js
42 lines (41 loc) · 1.12 KB
/
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
33
34
35
36
37
38
39
40
41
42
module.exports = function(api) {
api.cache(true);
const presets = [
["@babel/preset-env",{
// "useBuiltIns": "entry" ,
"useBuiltIns": "usage" ,
"corejs": 3,
"targets": { "node": "current" }
}]
];
const plugins = [
["angularjs-annotate"],
"lodash",
"babel-plugin-transform-async-to-promises",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining",
"wildcard",
//aliases are not DRY, setup here for Jest, in jsconfig.json for vscode and webpack for svelte
["module-resolver", {
"root": ["./src"],
//make it work with both
"alias": [
{"@yakit/core": "./yakit/core"},
{"@yakit/ui": "./yakit/ui"},
{"@yakit/svelte": "./yakit/svelte"},
{"@ag": "./src"},
{"angle-grinder/src": "./src"},
//used for demo
{ "~": "./examples/demo/src"},
]
}],
[ // required for svelte-jsx and svelte-fragment-component
"@babel/plugin-transform-react-jsx",
{"runtime": "automatic", "importSource": "svelte-jsx"}
]
];
return {
presets,
plugins
};
}