首页 > 解决方案 > 角度项目中的 mini-extract-css-plugin 问题

问题描述

我正在尝试从 webpack 迁移到 angular-cli,并且在构建项目时,我遇到了以下错误。

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
TypeError: Cannot read property 'replace' of undefined
    at normalizeBackSlashDirection (/home/User1/GIT/project1/node_modules/webpack/lib/RequestShortener.js:16:17)
    at new RequestShortener (/home/User1/GIT/project1/node_modules/webpack/lib/RequestShortener.js:26:15)
    at new Compiler (/home/User1/GIT/project1/node_modules/webpack/lib/Compiler.js:195:27)
    at Compiler.createChildCompiler (/home/User1/GIT/project1/node_modules/webpack/lib/Compiler.js:558:25)
    at Compilation.createChildCompiler (/home/User1/GIT/project1/node_modules/webpack/lib/Compilation.js:2243:24)
    at Object.pitch (/home/User1/GIT/project1/node_modules/mini-css-extract-plugin/dist/loader.js:66:43) 

我没有使用自定义 webpack,所以它在内部使用,因为依赖@angular-devkit/build-angular

这里可能是什么问题?

标签: cssangularmini-css-extract-plugin

解决方案


推荐阅读