{"id":22535708,"url":"https://github.com/lakphy/fontsliceplugin","last_synced_at":"2025-04-09T19:07:56.546Z","repository":{"id":210844838,"uuid":"723284654","full_name":"Lakphy/fontSlicePlugin","owner":"Lakphy","description":"一个基于woff2和fontmin的webpack字体分片工具","archived":false,"fork":false,"pushed_at":"2023-12-05T07:31:28.000Z","size":279,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T19:07:53.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lakphy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-25T07:07:28.000Z","updated_at":"2024-11-13T18:44:08.000Z","dependencies_parsed_at":"2023-12-05T07:42:49.487Z","dependency_job_id":null,"html_url":"https://github.com/Lakphy/fontSlicePlugin","commit_stats":null,"previous_names":["lakphy/fontsliceplugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lakphy%2FfontSlicePlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lakphy%2FfontSlicePlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lakphy%2FfontSlicePlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lakphy%2FfontSlicePlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lakphy","download_url":"https://codeload.github.com/Lakphy/fontSlicePlugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094994,"owners_count":21046770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T10:08:21.591Z","updated_at":"2025-04-09T19:07:56.508Z","avatar_url":"https://github.com/Lakphy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Font Slice Webpack Plugin\n\nThis plugin is used to split font files into single font files, so that font files can be loaded on demand in different pages.\n\nIt's my first time to write a webpack plugin. I hope it can help you.\n\nusage:\n\n```js\n{\n  webpack: (\n    config,\n    { buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }\n  ) =\u003e {\n    config.plugins.push(\n      new FontSlicePlugin({\n        fontDirectory: \"public/web_fonts\", // font directory\n        assetsDirectory: \".next/static\", // assets directory\n        tempDirectory: \".temp\", // temp directory, please make sure it's in .gitignore\n      })\n    );\n    return config;\n  };\n}\n```\n\n# Use Script Instead of Plugin?\n\nYou can use font-slice-plugin in your npm script now!\n\n`package.json`\n\n```json\n{\n  \"scripts\": {\n    \"build:fonts\": \"node scripts/build-fonts.js\"\n  }\n}\n```\n\n`scripts/build-fonts.js`\n\n```js\nconst { fontSliceWorker } = require(\"font-slice-plugin\");\n\nfontSliceWorker({\n  fontDirectory: \"public/web_fonts\", // font directory\n  assetsDirectory: \"public/static\", // assets directory\n  tempDirectory: \".temp\", // temp directory, please make sure it's in .gitignore\n});\n```\n\n`(in your terminal)`\n\n```bash\nnpm run build:fonts\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flakphy%2Ffontsliceplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flakphy%2Ffontsliceplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flakphy%2Ffontsliceplugin/lists"}