admin管理员组文章数量:1586763
最近一个gis 项目需要加载一个.cur的图标,但是编译时提示
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js/concepts#loaders (Source code omitted for this binary file)
显然是少配置了一个loader,接下来就开始配置
cli2 直接在webpack.base.config.js的module的 rules中新增如下配置即可
{
test: /\.(cur)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('cur/[name].[hash:7].[ext]')
}
},
而cli3 就更简单了,直接在vue.config.js中新增如下配置
chainWebpack: config => {
config.module
.rule('url-loader')
.test(/\.(cur)(\?.*)?$/)
.use('url-loader')
.loader('url-loader')
.end()
},
配置详情可以参考官网 https://cli.vuejs/guide/webpack.html#adding-a-new-loader
特此记录希望对有需要的伙伴一点帮助
版权声明:本文标题:.cur 图片加载提示 You may need an appropriate loader to handle this file type 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1726297689a1064802.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论