Choose one: is this a 馃悰 bug report or 馃檵 feature request?
This is possibly a bug.
.babelrc
{
"presets": ["env"]
}
.browserslistrc
last 1 Firefox versions
regeneratorRuntime shouldn't be used since I'm targeting only the most recent Firefox version, which natively supports async/await.
ReferenceError: regeneratorRuntime is not defined
Using babel-polyfill works, but since I'm creating a Firefox extension targeting the most recent version of Firefox, I don't want to transform async/await.
Here is a link to my Firefox extension this happened with. I've removed async/await rather than use the polyfill, but I haven't changed babelrc or browserslistrc from what it was when the issue happened.
https://github.com/lucaseverett/Firefox-Toolbar-Dial
Am I doing something incorrect in my setup? Am I wrong that async/await shouldn't be transformed into regeneratorRuntime when targeting "last 1 Firefox versions"?
I encountered a similar problem. It looks like that Parcel (or Babel?) ignores .browserslistrc
It should work when you add the query directly into .babelrc
{
"presets": [
[ "env", {
"targets": {
"browsers": "last 1 Firefox versions"
}
}]
]
}
But why do you use Babel at all when you target a modern browser?
Mystery solved. It's not implemented in the current version of babel-preset-env (1.6.1).
Support for browserslist comes with version 2
https://github.com/babel/babel-preset-env/pull/161
I also tried adding it directly in babelrc and that didn't make a difference, in my case.
I'm using Parcel for bundling. I don't know of any way to disable Babel and still be able to do that. I tried removing all references to Babel -- including deleting the babelrc file and removing preset-env from package.json -- but that didn't make a difference for my issue.
To disable Babel you remove the .babelrc file
Do you use the --no-cache option when you build the project?
parcel build --no-cache ....
With the cache Parcel does not pick up configuration changes when the code did not change.
Perfect, --no-cache solves the issue. Also, I tried using the babelrc you provided and that worked as well. So, I must have had a typo when I tried it earlier.
Thanks for your help! This issue is now resolved.
Most helpful comment
I encountered a similar problem. It looks like that Parcel (or Babel?) ignores .browserslistrc
It should work when you add the query directly into .babelrc
But why do you use Babel at all when you target a modern browser?