在使用 webpack 搭建 vue 项目时,添加了element-ui 在启动 webpack-dev-server 后报错
ERROR in ./node_modules/element-ui/lib/theme-chalk/fonts/element-icons.ttf 1:0
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
@ ./node_modules/element-ui/lib/theme-chalk/index.css (./node_modules/css-loader/dist/cjs.js!./node_modules/element-ui/lib/theme-chalk/index.css) 5:0-70 8:73-102
ERROR in ./node_modules/element-ui/lib/theme-chalk/fonts/element-icons.woff 1:4
Module parse failed: Unexpected character '' (1:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
@ ./node_modules/element-ui/lib/theme-chalk/inde
在Vue项目中使用Webpack搭建并引入Element-UI时,遇到启动webpack-dev-server报错,原因是字体文件中的特殊字符未被正确解析。解决方案是在webpack配置文件的module.rules部分添加file-loader来处理这些字体文件。
最低0.47元/天 解锁文章
830

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



