webpack配置踩坑心得_exclude和You may need an appropriate loader to handle this file type.

在尝试导入bootstrap.css 3.3.7版本时遇到错误,问题出在webpack配置的exclude选项。错误原因是exclude导致css-loader无法处理node_modules中的文件。解决方案是移除exclude配置,确保css, ttf等静态资源能被正确加载。" 122064845,8006423,利用OffscreenCanvas在Worker中异步绘制,"['canvas', 'web性能优化', '异步处理', 'Web Worker', '图像处理']
摘要由CSDN通过智能技术生成

问题描述

在导入 bootstrap.css 的时候,报错:此处 bootstrap 为 3.3.7 版本

ERROR in ./node_modules/bootstrap/dist/css/bootstrap.css 7:5
Module parse failed: Unexpected token (7:5)
You may need an appropriate loader to handle this file type.
|  */
| /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */

> html {
> |   font-family: sans-serif;
> |   -webkit-text-size-adjust: 100%;
>  @ ./src/components/CmtList.jsx 28:0-55 29:12-19
>  @ ./src/index.js
>  @ multi (webpack)-dev-server/client?http://localhost:8081 (webpack)/hot/dev-server.js ./src

可是我明明配置了 css-loader sass-loader less-loader file-loader url-loader 等各种loader。。。 

出错原因及解决办法

{
    test: /\.css$/,
    use: [
            'style-loader',
            'css-loader?modules&localIdentName=[path][name
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值