Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] how does one translate usage of .babelrc with esbuild? #27

Closed
samtsai opened this issue May 18, 2021 · 2 comments
Closed

[Question] how does one translate usage of .babelrc with esbuild? #27

samtsai opened this issue May 18, 2021 · 2 comments

Comments

@samtsai
Copy link

samtsai commented May 18, 2021

We use the below .babelrc. I'm having trouble understanding what gets replaced by switching to esbuild. Just following the basic craco replacements doesn't work for me. I immediately run into:

Expected "from" but found "{"

Which I suspect might be a different issue than babel, possibly cause we're using flow and we import types, e.g. import type { GlobalStore } from "app/redux".

{
  "presets": ["@babel/preset-flow", "@babel/preset-react", "@babel/preset-env"],
  "plugins": [
    "dynamic-import-node",
    "@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-nullish-coalescing-operator"
  ]
}

Any help to further understand this migration would be great!

@pradel
Copy link
Owner

pradel commented May 19, 2021

This plugin is replacing babel with esbuild, meaning that your babel config will not be used at all. At the current moment, esbuild only supports typescript and it doesn't seem that they are planning to support it at some point evanw/esbuild#79.

@pradel
Copy link
Owner

pradel commented Jun 7, 2021

Closing the issue, feel free to reopen if you still have questions

@pradel pradel closed this as completed Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants