当前位置: 首页 > news >正文

Vue2.0+webpack 引入字体文件(eot,ttf,woff)

 webpack.base.config.js 

需要配置

     {test:/\/(woff2?|eot|ttf|otf)(\?.*)?$/,loader: 'url-loader',options: {limit: 10000,name: utils.assetsPath('fonts/[name].[hash:7].[ext]')}}

如果 Vue2.0+webpack3.6引入字体文件(eot,ttf,woff)路径报错

These relative modules were not found:* ../fonts/music-icon.eot?2qevqt in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/postcss-loader/lib?{"sourceMap":true}!./node_modules/stylus-loader?{"sourceMap":true}!./src/common/stylus/index.styl
* ../fonts/music-icon.svg?2qevqt in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/postcss-loader/lib?{"sourceMap":true}!./node_modules/stylus-loader?{"sourceMap":true}!./src/common/stylus/index.styl
* ../fonts/music-icon.ttf?2qevqt in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/postcss-loader/lib?{"sourceMap":true}!./node_modules/stylus-loader?{"sourceMap":true}!./src/common/stylus/index.styl
* ../fonts/music-icon.woff?2qevqt in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/postcss-loader/lib?{"sourceMap":true}!./node_modules/stylus-loader?{"sourceMap":true}!./src/common/stylus/index.styl

将font.css 路径修改为 

 src: url('/static/fonts/music-icon.eot?2qevqt')src: url('/static/fonts/music-icon.eot?2qevqt#iefix') format('embedded-opentype'),url('/static/fonts/music-icon.ttf?2qevqt') format('truetype'),url('/static/fonts/music-icon.woff?2qevqt') format('woff'),url('/static/fonts/music-icon.svg?2qevqt#music-icon') format('svg')

http://www.lryc.cn/news/138430.html

相关文章:

  • Eureka:CAP原则及对比Zookeeper
  • WPF入门到精通:3.MVVM简单应用及全局异常处理
  • Springboot+mybatis-plus+dynamic-datasource+Druid 多数据源 分布式事务
  • 673. 最长递增子序列的个数
  • Android12之ABuffer数据处理(三十四)
  • whisper 语音识别项目部署
  • 实例044 在关闭窗口前加入确认对话框
  • 子查询和事务隔离以及用户管理
  • uniapp 滚动到指定元素的位置(锚点)
  • Spring AOP 的 afterReturing 返回值是否能修改问题
  • MyBatis分页插件PageHelper的使用及特殊字符的处理
  • [语音识别] 基于Python构建简易的音频录制与语音识别应用
  • Matlab彩色图像转索引图像
  • 测试框架pytest教程(11)-pytestAPI
  • Docker自学:利用FastAPI建立一个简单的web app
  • 微调bert做学术论文分类(以科大讯飞学术论文分类挑战赛为例)
  • Springboot中sharding-jdbc的API模式并使用自定义算法
  • MySQL回表是什么?哪些情况下会回表
  • VR、AR、MR 傻傻分不清楚?区别的底层逻辑?
  • VScode运行C语言出现的调试问题 lauch:program does not exist 解决方法
  • 云原生安全:保护现代化应用的新一代安全策略
  • mysql操作
  • 前端(十四)——DOM节点操作手册:你需要了解的一切
  • PDF怎么转成PPT文件免费?一个软件解决
  • 数据结构基础:P3-树(上)----编程作业02:List Leaves
  • 山西电力市场日前价格预测【2023-08-25】
  • 手机无人直播软件,有哪些优势?
  • SpringBoot概述SpringBoot基础配置yml的使用多环境启动
  • Python Pandas 处理Excel数据 制图
  • 如何自己实现一个丝滑的流程图绘制工具(五)bpmn的xml和json互转