Calling Object.entries, within the plug-in reports an error in the project.

The

project has a reference to a plug-in plugin , and Object.entries

is called in the plug-in.
// index.js
import Plugin from "plugin";

xxx...



// .babelrc
{
    "presets": [
        ["env", {
            "modules": false,
            "targets": {
                "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
            }
        }],
        "stage-0"
    ],
    "plugins": [
        "transform-vue-jsx",
        "transform-runtime",
        "syntax-dynamic-import",
        "transform-runtime"
    ]
}

result: Object.entries is no function.

then I add

to webpack.config.js
...
{
    test: /\.js$/,
    loader: "babel-loader",
    include: [resolve("src"), resolve("node_modules/plugin")]
}
...

result error exports is not defined

question:

  1. what"s wrong?
  2. does Object.entries need to add polyfills
Feb.27,2021

this is a function added to the class. You need to add


of polyfill. I can go to "modules: false" in babel-preset-env . I don't quite understand why

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38669-2c116.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38669-2c116.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?