1.0.0 • Published 6 years ago
font-minify-loader v1.0.0
fontmin-loader
Font minify loader for webpack.
Original Source
Install
npm install fontmin-loader
yarn add fontmin-loader
Usage
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.ttf$/,
use: [
{ loader: "url-loader" },
{ loader: "font-min-loader" }
]
}
]
}
}
css
@font-face{
font-family:"font name"
src:url("fontpath.ttf") format("woff")
}
Option
Subset
Compress by glyph.
webpack.config.js
{
loader: "font-min-loader" ,
options:{
text: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
}
}
OpenType
font-min-loader
supports default .ttf
but for .otf
webpack.config.js
{
loader: "font-min-loader" ,
options:{
otf:true
}
}
css
@font-face{
font-family:"font name"
src:url("fontpath.otf") format("woff")
}
1.0.0
6 years ago