Skip to content

usage of babel/polyfills #283

@br4nnigan

Description

@br4nnigan

so if I use browserify like this:

browserify src/test2.js -o dist/js/test.js -t [ babelify --presets [ @babel/preset-env ] ]

it is completely ignored that I want the polyfill to be used.

here's my .babelrc

{
  "presets": [
    ["@babel/preset-env", {
      "useBuiltIns": "usage",
      "loose": true,
      "modules": false,
      "targets": {
        "ie": "8"
      }
    }]
  ]
}

If I ommit the --presets from cli then @babel/preset-env will not be pulled from the .babelrc which I find strange, so maybe babelify ignores that file completely? But how to pass options via the cli then?

now if I just use babel directly like this:

node_modules\.bin\babel src/test2.js --out-file dist/js/test.js

the output file will actually kind of try to use the polyfill but use import statements like this, which makes it hardly usable:

import "core-js/modules/es6.string.includes";

I just need both, conversion if es6 imports AND injection of needed polyfills

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