Skip to content

babel-preset-env + babel-polyfill documentation is misleading #1660

@tkrotoff

Description

@tkrotoff

With Babel 6 (and 7) babel-preset-env and babel-polyfill documentations are misleading.

Based on my experimentations with babel-preset-env + babel-polyfill (for Babel 6) here: https://github.com/tkrotoff/babel-preset-env-example



Suggestions to improve babel-preset-env documentation:

  • Clearly state that babel-preset-env is not enough alone, you also need babel-polyfill (or manually include the polyfills you want)
  • Do not give examples with last 2 versions: not a good practice

Suggestions to improve babel-polyfill documentation:

  • Clearly state here that import 'babel-polyfill' is the preferred way because useBuiltIns: true won't work otherwise
  • Clearly state here that it's import 'babel-polyfill' OR webpack entry: ['babel-polyfill', './App.js'], not both

Also it should say somewhere there is nothing magic, Babel does not analyse the code to determine the needed polyfills :) i.e it will include Object.assign polyfill even if you don't use Object.assign inside your code: everything is based on targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions