Skip to content

Plugins order are incorrect: proposal-decorators compatibility with proposal-class-properties #105

@Carrotzpc

Description

@Carrotzpc

NOTE: Compatibility with @babel/plugin-proposal-class-properties
If you are including your plugins manually and using @babel/plugin-proposal-class-properties, make sure that @babel/plugin-proposal-decorators comes before @babel/plugin-proposal-class-properties.

https://babeljs.io/docs/en/babel-plugin-proposal-decorators#note-compatibility-with-babel-plugin-proposal-class-properties

$ npx babel-upgrade
npx: installed 192 in 54.298s
🙌  Thanks for trying out https://github.com/babel/babel-upgrade!

Updating .babelrc config at .babelrc
Index: .babelrc
===================================================================
--- .babelrc	Before Upgrade
+++ .babelrc	After Upgrade
@@ -15,10 +15,9 @@
         "useBuiltIns": "entry",
         "modules": false
       }
     ],
-    "@babel/preset-react",
-    "@babel/preset-stage-0"
+    "@babel/preset-react"
   ],
   "env": {
     "development": {
       "plugins": [
@@ -48,7 +47,33 @@
       {
         "libraryName": "antd",
         "libraryDirectory": "lib"
       }
-    ]
+    ],
+    "@babel/plugin-syntax-dynamic-import",
+    "@babel/plugin-syntax-import-meta",
+    "@babel/plugin-proposal-class-properties",
+    "@babel/plugin-proposal-json-strings",
+    [
+      "@babel/plugin-proposal-decorators",
+      {
+        "legacy": true
+      }
+    ],
+    "@babel/plugin-proposal-function-sent",
+    "@babel/plugin-proposal-export-namespace-from",
+    "@babel/plugin-proposal-numeric-separator",
+    "@babel/plugin-proposal-throw-expressions",
+    "@babel/plugin-proposal-export-default-from",
+    "@babel/plugin-proposal-logical-assignment-operators",
+    "@babel/plugin-proposal-optional-chaining",
+    [
+      "@babel/plugin-proposal-pipeline-operator",
+      {
+        "proposal": "minimal"
+      }
+    ],
+    "@babel/plugin-proposal-nullish-coalescing-operator",
+    "@babel/plugin-proposal-do-expressions",
+    "@babel/plugin-proposal-function-bind"
   ]
 }
\ No newline at end of file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions