ecomfe / fontmin

Minify font seamlessly

Home Page:http://ecomfe.github.io/fontmin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webpack 整合 fontmin 的 case

chriswong opened this issue · comments

commented

现有构架是 webpack + fontawesome,期望可以在 webpack 中直接加入 fontmin(fontmin-loader?)实现,最理想是现存样式中的 \Fxxx 无需修改。

fontawesome 大多数人 应该是这样用的吧

<i class="fa fa-camera-retro fa-lg"></i> fa-lg
<i class="fa fa-camera-retro fa-2x"></i> fa-2x
<i class="fa fa-camera-retro fa-3x"></i> fa-3x
<i class="fa fa-camera-retro fa-4x"></i> fa-4x
<i class="fa fa-camera-retro fa-5x"></i> fa-5x

如果 还要考虑 使用 .vue, .jsx 的话
确实 有点麻烦呢
通过类似 extract-text-webpack-plugin 的方案解决怎么样?

commented

我没有直接这样用,用的 mixin,fa(search) 这种

extract-text-webpack-plugin 跟 fontmin 怎么结合?

啥 mixin? 求代码?

估计要做个 fontmin-text-webpack-plugin 收集特征

commented

https://github.com/raulghm/Font-Awesome-Stylus/blob/master/lib/font-awesome-stylus/mixins.styl#L24

收集特征是指遍历相关的样式代码,找 content: '\Fxxx' 这样的代码?