pugjs / babel-plugin-transform-react-pug

A plugin for transpiling pug templates to jsx
MIT License
808 stars 46 forks source link

How to use this plugin with create-react-app repo? #41

Closed morwin10 closed 6 years ago

morwin10 commented 6 years ago

I tried to do that but I get 'pug' is not defined no-undef

I copied these lines to package.json like that

"babel": {
  "plugins": [
    "transform-react-pug",
    "transform-react-jsx"
  ]
}
luisoutofoffice commented 6 years ago

You will have to eject the create-react-app in order to add babel plugins

ForbesLindesay commented 6 years ago

@letorruella is correct

ezhlobo commented 6 years ago

@morwin10 there are few other options, like react-app-rewired.

Personally I use module-alias package and modify webpack config to allow .babelrc file in root directory. Then I modify all babel configurations as I want.

//CC @letorruella