We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
发现webpack没法直接处理html中引入到图片问题,比如下面这样
<div className="apple"><img src="../images/apple.png" alt=""/></div>
上面这个图片对应的路径是开发环境下的地址,但是打包后的资源文件是assets, webpack并不会这样引入的图片,要解决这个问题有几种方式
src="assets/apple.png"
The text was updated successfully, but these errors were encountered:
第三方式这样写
<div className="apple"><img src={require('../images/apple.png')} alt=""/></div>
webpack打包的时候回去找这个图片,并且回应用url-loader的规则,小于8kb转base64
Sorry, something went wrong.
No branches or pull requests
发现webpack没法直接处理html中引入到图片问题,比如下面这样
上面这个图片对应的路径是开发环境下的地址,但是打包后的资源文件是assets, webpack并不会这样引入的图片,要解决这个问题有几种方式
src="assets/apple.png"
The text was updated successfully, but these errors were encountered: