-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbabel.config.js
53 lines (52 loc) · 1.55 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
/*eslint-env node*/
/**
* @type {import("@babel/core").TransformOptions}
*/
module.exports = {
exclude: [
/\bcore-js\b/i,
/\bwebpack\b/,
/\bregenerator-runtime\b/,
],
presets: [
[
"@babel/preset-env",
/** @type {typeof import("@babel/preset-env")._default} */
{
useBuiltIns: "usage", // polyfills on use
corejs: 3, // use core-js@3
modules: "umd",
},
],
[
"@vue/babel-preset-jsx",
{
functional: true,
injectH: true,
vModel: true,
vOn: true,
},
],
],
plugins: [
"@babel/plugin-proposal-function-bind", // array.map(::this.myMethod)
"@babel/plugin-proposal-class-properties", // class { myMember = 10; }
"@babel/plugin-proposal-object-rest-spread", // {...myObj}
"@babel/plugin-proposal-do-expressions", // const two = do{ if(false) 0; else 2;s }
"@babel/plugin-proposal-numeric-separator", // const twoK = 2_000;
"@babel/plugin-proposal-nullish-coalescing-operator", // const stuff = null ?? "stuff";
"@babel/plugin-proposal-optional-chaining", // window?.might?.have?.this?.property?.doStruff();
"@babel/plugin-proposal-throw-expressions", // onError(() => throw new TypeError("OnO"));
[
"@babel/plugin-proposal-pipeline-operator", { // '1' |> parseFloat |> timesTwo |> plusFourty
proposal: "fsharp",
},
],
"@babel/plugin-proposal-partial-application", // doStuff(?, 42) is the new (x => doStuff(x, 42))
"@babel/plugin-syntax-dynamic-import", // import("myComponent.vue").then(...)
//
"@babel/plugin-syntax-jsx",
"babel-plugin-transform-jsx",
"babel-plugin-jsx-v-model",
],
};