Does not honor .babelrc
See original GitHub issuebabel-watch
does not seem to honor my .babelrc
Currently:
{
"presets": ["latest", "react", "stage-0"],
"plugins": ["transform-decorators-legacy"]
}
Running my code with babel-watch
and this error is thrown: regeneratorRuntime is not defined
While babel-node
I am good to go
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Root .babelrc not being read · Issue #13577 - GitHub
I expect storybook to honor my .babelrc file at the project root level. Screenshots Notice the pink background when .babelrc is in .storybook...
Read more >Make babel exclude test files - node.js - Stack Overflow
I've edited the answer...it seems that the .bablerc ignore is not honored. I've noticed several variations of this being reported on their ...
Read more >Configure Babel
How Babel merges config items. Babel's configuration merging is relatively straightforward. Options will overwrite existing options when they are present and ...
Read more >Babel 7 Released
After almost 2 years, 4k commits, over 50 pre-releases, and a lot of help we are excited to announce the release of Babel...
Read more >Config Files - Babel.js
The primary downside of this project-wide config is that, because it relies on the working directory, it can be more painful to use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@larron Thanks to your example code I managed to get that issue reproed.
It appears that
babel-node
automatically importsbabel-polyfill
for every process it runs. In my opinion this may lead to confusion as whenever you run your code withbabel-node
it will work fine, but when you want to run it in production it is recommended to build it first and then run with regular node. In which case you’ll end up getting the same error as you have here.Now I believe that the proper solution is what @jadsonlourenco suggested and I no longer consider it to be a workaround. I’ve also found an alternative solution which makes babel add
babel-polyfill
in the transpilation step and you don’t need to add it manually:Then add this to your .babelrc plugin section:
I’m closing this issue, and will update troubleshooting section on the main page with information about this issue.
Thanks everyone for participating in the discussion
Try:
npm i babel-polyfill --save-dev
, then addimport 'babel-polyfill'
to your main.js file.