首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Core-JS 3 Babel导致迷你css-extract-plugin错误

Core-JS 3 Babel导致迷你css-extract-plugin错误
EN

Stack Overflow用户
提问于 2020-05-04 01:27:08
回答 1查看 934关注 0票数 1

this question之后,我设置了我的Webpack 4配置来处理babel-loader,如下所示

代码语言:javascript
复制
{
  module : {
    rules : [{
      test : /\.js$/,
      // Some module should not be transpiled by Babel
      // See https://github.com/zloirock/core-js/issues/743#issuecomment-572074215
      exclude: ['/node_modules/', /\bcore-js\b/, /\bwebpack\/buildin\b/, /@babel\/runtime-corejs3/],
      loader : "babel-loader",
      options : {
        babelrc : false,
        // Fixes "TypeError: __webpack_require__(...) is not a function"
        // https://github.com/webpack/webpack/issues/9379#issuecomment-509628205
        // https://babeljs.io/docs/en/options#sourcetype
        sourceType : "unambiguous",
        presets : [
          ["@babel/preset-env", {
            // Webpack supports ES Modules out of the box and therefore doesn’t require
            // import/export to be transpiled resulting in smaller builds, and better tree
            // shaking. See https://webpack.js.org/guides/tree-shaking/#conclusion
            modules : false,
            // Adds specific imports for polyfills when they are used in each file.
            // Take advantage of the fact that a bundler will load the polyfill only once.
            useBuiltIns : "usage",
            corejs : {
              version : "3",
              proposals : true
            }
          }]
        ]
      }
    }
  }
}

当我在浏览器中运行它时,我得到了这个我不理解的错误:

代码语言:javascript
复制
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
TypeError: Cannot convert undefined or null to object

解决这个问题的方法是什么?在this question之后,我到处寻找启动import 'core-js的代码,但在任何地方都找不到,所以走到了死胡同。

EN

回答 1

Stack Overflow用户

发布于 2020-12-17 17:11:53

我有一个类似的问题,原因是巴别塔正在转译我的css-loader webpack插件。看这里:MiniCssExtractPlugin error on entry point build

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61578788

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档