url-loader配置limit只要大于10000就会失效的问题与解决方案 #736
shaojun427
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
起因:有个12KB的图片需要走url-loader,但是不管limit怎么配置,只要大于10000就必走file-loader,但是limit设置小于10000的又能生效,百思不得其解。





配置怎么看都没有问题,于是乎直接搜源码
因为fatherjs的构建是走的umijs的,所以直接搜limit逻辑,发现被umi的inlineLimit限制住了
找到原因了,但是fatherjs没有开出umi config的口子
那么只能在fatherrc直接chainWebpack顶掉原来的逻辑了
url-loader依赖也不用装了,直接走umi bundle的url-loader。
就是现在这个文档写的是真的烂,这种大众需求,issue也搜不到,还得自己看源码。
Beta Was this translation helpful? Give feedback.
All reactions