Skip to content
New issue

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

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

Already on GitHub? # to your account

How to use this babel plugin in latest create-react-app ? #87

Open
popcornkiller1088 opened this issue Jan 19, 2019 · 5 comments
Open

Comments

@popcornkiller1088
Copy link

Try to use this plugin in create react app, I run npm eject but that's no .babelrc file, just a config folder with some webpack config.

@popcornkiller1088
Copy link
Author

Hi, just found out put instead of put those code inside babel.rc, I can put those code in package.json.

  "babel": {
    "presets": [
      "react-app"
    ],
    "plugins": [
      "transform-react-pug"
    ]
  },

and will require to install eslint, then, add those code in package.json to configure eslint.

  "eslintConfig": {
    "plugins": [
      "react-pug"
    ],
    "extends": [
      "react-app",
      "plugin:react-pug/all"
    ]
  },

@ezhlobo
Copy link
Member

ezhlobo commented Jan 22, 2019

@popcornkiller1088 that's a good information for others, I think we should add this to README. Thanks ;).

@Venryx
Copy link

Venryx commented Feb 15, 2020

Hi, just found out put instead of put those code inside babel.rc, I can put those code in package.json.

Where did you read this?

I tried, and any babel configuration in the package.json file gets ignored.

@popcornkiller1088
Copy link
Author

My answer is 1 years ago, I think the create-react-app might have change their way of configure things

@Venryx
Copy link

Venryx commented Feb 15, 2020

I ended up using this: https://github.com/timarney/react-app-rewired

And this (using it's addBabelPlugin function): https://github.com/arackaf/customize-cra

It works fine (so issue can be closed); though I do wish create-react-app supported configuration extensions intrinsically.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants