project has a reference to a plug-in plugin
, and Object.entries
// 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:
- what"s wrong?
- does Object.entries need to add polyfills