未捕获的 ReferenceError: require is not defined at Object.babel-polyfill at __webpack_require__

时间:2021-05-24 07:16:08

标签: javascript webpack babeljs babel-polyfill

我收到一个错误 Uncaught ReferenceError: require is not defined at Object.babel-polyfill at webpack_require

我正在将模块与 webpack 捆绑在一起,并且在遵循文档 https://babeljs.io/docs/en/babel-preset-env#modules 之后,我明白所需的操作是 module: "auto"。 但无法使其工作。 这是我的 .babelrc

    "presets":[
        ["@babel/preset-env",{
            "targets":{
                "browsers":[
                    "last 5 versions",
                    "ie >= 10"
                ], 
                "esmodules": true
            }
        }
        ]
    ],
    
    "plugins": ["@babel/plugin-transform-runtime","dynamic-import-node"]
    }```

Help me solve the issue!!

0 个答案:

没有答案