npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

chinese-fontmin-webpack-plugin

v1.0.0

Published

中文 Fontmin Webpack 插件

Downloads

2

Readme

chinese-fontmin-webpack-plugin

中文 Fontmin Webpack 插件

目前该插件支持以下功能:

  • 常用汉字提取,包括:
    • 《现代汉语常用字表》常用字(2500字)
    • 《现代汉语常用字表》次常用字(1000字)
    • 《现代汉语通用字表》(7000字)
  • 常见符号数字提取,如:
    • 26 个英文字母和部分法文字母
    • 数字
    • 常用中英文符号
  • 自定义文字提取

如何使用

目前,此插件是基于 Webpack 5 开发的,Webpack 4.x 版本未经测试。

webpack.config.js 下的 plugins 字段里,添加以下代码:

const {ChineseFontminWebpackPlugin} = require('chinese-fontmin-webpack-plugin')
...

plugins: [
  new ChineseFontminWebpackPlugin({
      han2500: true, // 是否提取常用 2500 汉字
      han1000: true, // 是否提取常用 1000 汉字
      han7000: false, // 是否提取常用 7000 汉字
      alphabet: true, // 是否提取字母
      number: true, // 是否提取数字
      punctuation: true, // 是否提取标点符号
      custom: {
        text: '', // 自定义文字
        replace: false, // 是否覆盖上述的字段(如常用汉字),是则只提取自定义文字,否则在上述字段后追加自定义文字
      },
  }),
],

...

例子

请查看 example 文件夹内的 webpack.config.js 文件。

注意事项

在使用前,请先下载 Fontmin app,确保字体文件在 app 中本身就能正确提取。

custom.text = ''custom.replace = true 的时候,Fontmin 会直接输入原来的文件。