website
website copied to clipboard
Updated plugin acceptance docs for include/exclude options in preset-env
The docs about include (https://babeljs.io/docs/en/babel-preset-env#include say that plugins prefixed with plugin-
are valid, which is false. The only valid plugin names are those prefixed with @babel/
, @babel/plugin-
, babel-
, babel-plugin-
. The problem is with the regex normalizing polyfill names here: https://github.com/babel/babel/blob/9a52019019527be8c179ea7c9025fa2355f16170/packages/babel-preset-env/src/normalize-options.js#L104. Also in versions 6.23.3
and 7.0.0
only babel-plugin-
prefix is accepted.
The PR updates every doc version of preset-env
about which plugin prefixes are accepted in the include
and exclude
options.
Deploy preview for babel ready!
Built without sensitive environment variables with commit c96bc6151eb70fbc20e6f044a9842df51f4bd201
https://deploy-preview-2250--babel.netlify.app
Thanks!
Find it hard to parse:
Maybe work better as nested list items?
I agree it's somewhat hard to read, but I'm not sure what you are referring to how I should modify it, may you please be more specific? Thanks.
@existentialism What do you think about the new version?
My initial thought was something like:
Valid options include any:
* Babel plugins - both full and shorthand names are supported, for example the following are functionally equivalent:
* @babel/plugin-transform-spread
* @babel/transform-spread
* babel-transform-spread
* transform-spread
Thoughts?
Yes, that's way better and more readable, I agree. Will change it to that format.