New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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

  • 1.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
915
increased by1.78%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc