website icon indicating copy to clipboard operation
website copied to clipboard

Updated plugin acceptance docs for include/exclude options in preset-env

Open JMarkoski opened this issue 4 years ago • 6 comments

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.

JMarkoski avatar May 14 '20 17:05 JMarkoski

Deploy preview for babel ready!

Built without sensitive environment variables with commit c96bc6151eb70fbc20e6f044a9842df51f4bd201

https://deploy-preview-2250--babel.netlify.app

netlify[bot] avatar May 14 '20 17:05 netlify[bot]

Thanks!

Find it hard to parse:

image

Maybe work better as nested list items?

existentialism avatar May 14 '20 18:05 existentialism

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.

JMarkoski avatar May 14 '20 19:05 JMarkoski

@existentialism What do you think about the new version?

JMarkoski avatar May 15 '20 16:05 JMarkoski

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?

existentialism avatar May 16 '20 15:05 existentialism

Yes, that's way better and more readable, I agree. Will change it to that format.

JMarkoski avatar May 16 '20 21:05 JMarkoski