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

fis-deploy-fontspider

v1.0.2

Published

a fis3 deploy plugin with fontspider

Downloads

2

Readme

Usage

fis3配置:

//开启相对路径,需要安装fis3-hook-relative,如果没有开启此项,会导致读取不到字体文件地址而报错。
fis.hook( 'relative' );

fis.match( '**.html', {
    deploy: [ fis.plugin( 'local-deliver', {
      to: './output'
    } ) , fis.plugin( 'fontspider', {
        to: './output'
    })]
  } );

// 或者
fis.match( '**.html', {
    deploy: [ fis.plugin( 'fontspider', {
        to: './output'
    })]
  } );

Options

参考font-spider

{

    // 最终输出文件夹,deploy插件是在构建完成之后处理的,所以不影响源文件
    // 必须配置此项,否则文件路径会出现问题
    "to": "./output",

    /*下列选项来自font-spider提供的选项*/
    /**
     * 忽略加载的文件规则(支持正则) - 与 `resourceIgnore` 参数互斥
     * @type    {Array<String>}
     */
    "ignore": [],

    /**
     * 映射的文件规则(支持正则) - 与 `resourceMap` 参数互斥 - 可以将远程字体文件映射到本地来
     * @type    {Array<Array<String>>}
     * @example [['http://font-spider.org/font', __diranme + '/font'], ...]
     */
    "map": [],

    /**
     * 是否支持备份原字体
     * @type    {Boolean}
     */
    "backup": true,

    /**
     * 是否对查询到的文本进行去重处理
     * @type    {Boolean}
     */
    "unique": true,

    /**
     * 是否排序查找到的文本
     * @type    {Boolean}
     */
    "sort": true,

    /**
     * 是否开启调试模式
     * @type    {Boolean}
     */
    "debug": false,

    /**
     * 是否支持加载外部 CSS 文件
     */
    "loadCssFile": true,

    /**
     * 是否忽略内部解析错误-关闭它有利于开发调试
     * @type    {Boolean}
     */
    "silent": true,

    /**
     * 请求超时限制
     * @type    {Number}    毫秒
     */
    "resourceTimeout": 8000,

    /**
     * 最大的文件加载数量限制
     * @type    {Number}    数量
     */
    "resourceMaxNumber": 64,

    /**
     * 是否缓存请求成功的资源
     * @type    {Boolean}
     */
    "resourceCache": true,

    /**
     * 映射资源路径 - 与 `map` 参数互斥
     * @param   {String}    旧文件地址
     * @return  {String}    新文件地址
     */
    "resourceMap": function(file) {},

    /**
     * 忽略资源 - 与 `ignore` 参数互斥
     * @param   {String}    文件地址
     * @return  {Boolean}   如果返回 `true` 则忽略当当前文件的加载
     */
    "resourceIgnore": function(file) {},

    /**
     * 资源加载前的事件
     * @param   {String}    文件地址
     */
    "resourceBeforeLoad": function(file) {},

    /**
     * 加载远程资源的自定义请求头
     * @param   {String}    文件地址
     * @return  {Object}
     */
    "resourceRequestHeaders": function(file) {
        return {
            'accept-encoding': 'gzip,deflate'
        };
    }
}