1.0.4 • Published 7 years ago

awesome-fontmin-loader v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

awesome-fontmin-loader

NPM version node Downloads Dependencies

Fontmin loader for webpack,use to cut font files from texts.

Suport: ttf,eot,woff,woff2,svg

You can use charactor-scanner if you want to pick charactors from your code files.

const Scan = require('charactor-scanner');
let text = Scan({
  dir: path.resolve(__dirname, './code-directory'),
  sync: true
}).join('')

Usage

npm install --save-dev awesome-fontmin-loader

Webpack 2.x config:

{
  test: /\.(svg|woff|woff2|ttf|eot)$/,
  use: [
    {
      loader: 'awesome-fontmin-loader',
      options: {
        limit: 1000,
        name: 'assets/fonts/[name].[hash].[ext]',
        text: 'FOOBAR'
      }
    }
  ]
}

Webpack 1.x config:

{ test: /\.(svg|woff|woff2|ttf|eot)$/, loader: "awesome-fontmin?limit=1000&name=fonts/[name].[ext]&text='FOOBAR'" },

Limitations

Fonts must have the same name and path as the TrueType version of the font.

Ralated

if you perfer a webpack plugin to a loader, you can see: fontmin-webpack plugin

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago