标签:package url append mic option base test 解决 style
1.安装依赖
npm i url-loader -D
2.js 中使用图片
import logo from ‘./image/1.png‘ let image = new Image(); image.src = logo; document.body.appendChild(image);
3. webpack.config.js
{ test: /\.(jpg|png|bmp|gif|svg)/, use: [ { loader: ‘url-loader‘, options: { limit: 4096 } } ] },
4. 测试
图片正常显示出来
标签:package url append mic option base test 解决 style
原文地址:https://www.cnblogs.com/guangzhou11/p/12466366.html