nuxt / create-nuxt-app

Create Nuxt.js App in seconds.
MIT License
3.48k stars 429 forks source link

babel.config.json instead of .babel.rc on project creation #851

Open cosad3s opened 3 years ago

cosad3s commented 3 years ago

Is your feature request related to a problem? Please describe.

I just encounter the problem with Jest running and solve it by renaming .babelrc by babel.config.json (It should also works with babel.config.js I think). Also, I notice that several Nuxt.js projects examples use babel.config.js instead of .babelrc file.

Describe the solution you'd like

With the Nuxt project init tool (i.e. npm init nuxt-app PROJECT), use the filename babel.config.json instead of .babelrc, with same content for better compatibility with Jest. It also needs additional modifications in the nuxt.config.js file (See https://github.com/nuxt/nuxt.js/issues/8268#issuecomment-719564885)

Describe alternatives you've considered

N/A

Additional context

I am far to be an expert with Nuxt/Jest/Babel, so I could understand if anyone with better experience thinks that could not be a good idea. But I lost a lot of time to find out the solution to this problem ... I prefer suggest this little enhancement.