babel编译时报错
问题描述:
babel编译时报错,怎么能解决这个问题?
export 'default' (imported as '_forEachInstanceProperty') was not found in '@babel/runtime-corejs3/core-js-stable/instance/for-each' (possible exports: __esModule)
相关截图:
相关代码:
const path = require('path');
module.exports = {
entry: './core/cli/bin/core.js',
output: {
path: path.join(__dirname, '/dist'),
filename: 'core.js'
},
externals: {
'import-local': `require("import-local")`
},
mode: 'development', // 'production'
target: "node",
module: {
rules: [
{
test: /\.js$/,
exclude: /(dist)/,
use: {
loader: 'babel-loader',
options: {
presets: [ "@babel/preset-env" ],
plugins: [
[
"@babel/plugin-transform-runtime",
{
"corejs": 3,
"helpers": true,
"regenerator": true,
"useESModules": true
}
]
]
}
}
}
]
}
}
尝试过的解决方式:
安装
babel-plugin-syntax-dynamic-import
51
收起
正在回答
1回答
同学你好,可以把项目代码上传到github或是码云这些代码托管平台,把地址发我一下,我在本地帮你测试定位一下问题。
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星