Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@beyonk/google-fonts-webpack-plugin

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyonk/google-fonts-webpack-plugin

Google Fonts Webpack plugin

latest
Source
npmnpm
Version
1.7.0
Version published
Weekly downloads
565
-29.9%
Maintainers
3
Weekly downloads
 
Created
Source

Google Fonts Webpack Plugin

Compatible with Webpack >= 4.14.0 and >= 5.0.0

Download Google fonts to webpack build folder using google-webfonts-helper or use CDN to integrate with html-webpack-plugin.

publish

Install

npm install @beyonk/google-fonts-webpack-plugin

Usage

/webpack.config.js

const GoogleFontsPlugin = require("@beyonk/google-fonts-webpack-plugin")

module.exports = {
	"entry": "index.js",
	/* ... */
	plugins: [
		new GoogleFontsPlugin({
			fonts: [
				{ family: "Source Sans Pro" },
				{ family: "Roboto", variants: [ "400", "700italic" ], display: "block" }
			]
			/* ...options */
		})
	]
}

Options

new GoogleFontsPlugin(options: Object)
NameTypeDefaultDescription
fontsFontObject[]-Configuration generated by Fontello.com.
nameString"fonts"Module name.
filenameString"fonts.css"Css file name.
pathString"font/"Relative path to fonts directory. If path is undefined fonts are not downloaded, the css file is generated with Google hosted font files.
localBooleantrueWhether to use google-webfonts-helper API or just link to Google Fonts hosted css. If this option is set to false this plugin just adds the css url to html-webpack-plugin (if present).
noLocalInCssBooleanfalseWhether to prepend local(FontName) expression before font files in CSS file (see MDN).
formatsArray[ "eot", "woff", "woff2", "ttf", "svg" ]Font formats to download.
apiUrlString"https://google-webfonts-helper.herokuapp.com/api/fonts"google-webfonts-helper API url.

FontObject

NameTypeDefaultDescription
familyString-Font family.
variantsArray-Font variants according to google-webfonts-helper (e.g.: [ "italic", "500", "700italic" ]).
subsetsArray-Font subsets according to google-webfonts-helper (e.g.: [ "latin", "greek" ]).
formatsArray-Font formats to download. Defaults to options.formats.
displayString"swap"Font Display

Keywords

google

FAQs

Package last updated on 12 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts