forked from NanaMorse/Cuckoo.Plus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbabel.config.js
56 lines (54 loc) · 1.51 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import pkg from "./package.json" with { type: "json" }
/** @type {"usage" | "entry" | false} */
const useBuiltIns = "usage"
/** @type {import('@babel/core').TransformOptions} */
export default {
sourceType: (/** @type {'module'} **/ ('module')),
presets: [
[
"@babel/preset-env",
{
modules: false,
useBuiltIns,
corejs: pkg.dependencies["core-js"],
include: [
// promise polyfill alone doesn't work in IE,
// needs this as well. see: vuejs/vue-cli#1642
"es.array.iterator",
// this is required for webpack code splitting, vuex etc.
"es.promise",
// this is needed for object rest spread support in templates
// as vue-template-es2015-compiler 1.8+ compiles it to Object.assign() calls.
"es.object.assign",
// #2012 es.promise replaces native Promise in FF and causes missing finally
"es.promise.finally"
]
}
],
[
"@vue/babel-preset-jsx",
{
compositionAPI: true
}
]
],
plugins: [
"@babel/plugin-syntax-dynamic-import",
[
"@babel/plugin-proposal-decorators",
{
legacy: true
}
],
[
"@babel/plugin-transform-runtime",
{
regenerator: useBuiltIns !== "usage",
// polyfills are injected by preset-env, so no need to add them again
corejs: false,
helpers: useBuiltIns === "usage",
version: pkg.devDependencies["@babel/runtime"]
}
]
]
}