Skip to content

How to ignore babel config file in root #7365

Answered by nickcernis
Murderlon asked this question in Q&A
Discussion options

You must be logged in to vote

I used the documentation here that explains how to ignore Babel so that Parcel 2 uses its own transpiler:

https://parceljs.org/languages/javascript/#usage-with-other-tools

In short, you have to add a .parcelrc to your project root that excludes the usual @parcel/transformer-babel from the transformers list:

{
  "extends": "@parcel/config-default",
  "transformers": {
    "*.{js,mjs,jsx,cjs,ts,tsx}": [
      "@parcel/transformer-js",
      "@parcel/transformer-react-refresh-wrap"
    ]
  }
}

(In config-default @parcel/transformer-babel normally appears at the top of that transformers list, so the override above ensures that Parcel excludes the Babel transformer and will not process your B…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Murderlon
Comment options

Answer selected by Murderlon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants