使用webpack的mini-css-extract-plugin插件出现的问题

ERROR in ./src/components/style.less
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ReferenceError: document is not defined
// ./src/components/style.less 中的错误
// 模块构建失败(来自 ./node_modules/mini-css-extract-plugin/dist/loader.js):
// 参考错误:文档未定义
解决办法:

删除掉这个 ‘style-loader’ 在运行就没问题了

本文探讨了在使用Webpack的mini-css-extract-plugin时遇到的'文档未定义'错误,解决方案是移除style-loader,确保正确配置CSS分离。
1万+

被折叠的 条评论
为什么被折叠?



