WebPack引用Bootstrap 无法使用图标的结局方案

npm i https://github.com/iconic/open-iconic.git -D 因为boostrap的css里删除了图标 分开了 我们在引入个呵呵。

下载:npm i bootstrap@4.1.3 -D

由于4.x版本icon文件分离出去所以还需要下载open-iconic:

npm i https://github.com/iconic/open-iconic.git -D(下载可能有点慢,要花个几分钟,可用cnpm下载)

在index.js中引入

import 'bootstrap/dist/css/bootstrap.css'
import 'open-iconic/font/css/open-iconic-bootstrap.css'

在webpack.config.js中配置

在html中引用

<span class="oi oi-account-login"></span>
<span class="oi oi-account-logout"></span>