Gathering detailed insights and metrics for @daipeng7/rollup-plugin-iconfont
Gathering detailed insights and metrics for @daipeng7/rollup-plugin-iconfont
npm install @daipeng7/rollup-plugin-iconfont
Typescript
Module System
Node Version
NPM Version
53.3
Supply Chain
85.1
Quality
72.8
Maintenance
25
Vulnerability
95.4
License
JavaScript (65.13%)
Nunjucks (34.29%)
Shell (0.58%)
Total Downloads
7,007
Last Day
8
Last Week
133
Last Month
565
Last Year
5,684
2 Stars
12 Commits
1 Forks
3 Watching
1 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
3.0.6
Package Id
@daipeng7/rollup-plugin-iconfont@3.0.6
Unpacked Size
36.60 kB
Size
9.86 kB
File Count
25
NPM Version
10.5.0
Node Version
18.20.2
Publised On
22 May 2024
Cumulative downloads
Total Downloads
Last day
-94.2%
8
Compared to previous day
Last week
-45%
133
Compared to previous week
Last month
2.7%
565
Compared to previous month
Last year
647.9%
5,684
Compared to previous year
11
25
Use svg files to build iconfont files(ttf,woff2,woff,eot,svg), css file, js data file and html-preview file.
npm install -D @daipeng7/rollup-plugin-iconfont
You can use it by nodejs directly or use it in webpack
build/svg2font.js:
1var IconfontWebpackPlugin = require("@daipeng7/rollup-plugin-iconfont"); 2var path = require("path"); 3var dir = "test/web_project/"; 4var options = { 5 svgs: resolve("src/assets/svgs/*.svg"), 6 fontsOutput: resolve("src/style/iconfont/fonts"), 7 cssOutput: resolve("src/style/iconfont/index.css"), 8 fontName: "custom-iconfont", 9 jsOutput: false, 10 htmlOutput: false, 11 template: "scss", 12 // Font loads the absolute path. If not set, the relative path will be automatically calculated based on `cssOutput` and `fontsOutput`. 13 // cssFontPath: '', 14 // iconFont name prefix 15 cssPrefix: "ift", 16}; 17 18IconfontWebpackPlugin(options).buildStart();
Then you can run this command to build iconfont by svg:
1node build/svg2font.js
Or you can set this command to script of package.json, and run it by npm.
1var IconfontWebpackPlugin = require("@daipeng7/rollup-plugin-iconfont"); 2var dir = "test/web_project/"; 3 4module.exports = { 5 //... others 6 plugins: [ 7 IconfontWebpackPlugin({ 8 svgs: path.join(dir, "svgs/*.svg"), 9 svgs: resolve("src/assets/svgs/*.svg"), 10 fontsOutput: resolve("src/style/iconfont/fonts"), 11 cssOutput: resolve("src/style/iconfont/index.css"), 12 fontName: "custom-iconfont", 13 jsOutput: false, 14 htmlOutput: false, 15 template: "scss", 16 cssFontPath: "style/iconfont/fonts", 17 cssPrefix: "ift", 18 watch: false, 19 }), 20 ], 21};
svgs
(required)Type: String
File path(s) or glob(s) to svg icons. Recommend to use .svg like this: /src/project/src/.svg, this can watch svgs by directory.
fontsOutput
(required)Type: String
Destination for generated font files (directory).
cssOutput
(required)Type: String
Destination for generated css file (file name).
fontName
Type: String
Default value: iconfont
The font family name (e.g. font-family: 'iconfont'
).
htmlOutput
Type: String
Default value: [path of cssOutput] + /font-preview.html
. Or false
value.
Destination for generated html-preview file (file name). If false
, no html and js output.
template
Type: String
Default value: css
Type of built in style templates ('css', 'scss', 'scss-mixins') or path to custom template.
formats
Type: Array of String
Default value: ['svg', 'ttf', 'eot', 'woff2', 'woff']
The output iconfont formats.
cssPrefix
Type: String
Default value: fontName
Css className prefix.
jsOutput
Type: String
Default value: undefined.
Path of a js file which contains all svg contents. Optional.
jsPrefix
Type: String
Default value: '/_ eslint-disable _/\n'
Js file content prefix.
cssFontPath
Type: String
Default value: path.relative(path.dirname(options.cssOutput), options.fontsOutput);
Font url path in cssOutput
file.
success
Type: Function
Default value: undefined
Iconfonts be created.
watch
Type: Boolean
Default value: undefined
Watch file change.
https://www.npmjs.com/package/svgicons2svgfont
https://www.npmjs.com/package/svg2ttf
https://www.npmjs.com/package/ttf2eot
https://www.npmjs.com/package/ttf2woff
https://www.npmjs.com/package/ttf2woff2
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
9 existing vulnerabilities detected
Details
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More