# google-fonts-webpack-plugin

> Google Fonts Webpack plugin

Latest version **0.4.4** (published 2017-12-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install google-fonts-webpack-plugin
pnpm add google-fonts-webpack-plugin
yarn add google-fonts-webpack-plugin
bun add google-fonts-webpack-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.4 |
| Published | 2017-12-22 |
| First published | 2017-03-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 131 |
| Author | Gabriela Seabra |
| Maintainers | gabiseabra |
| Keywords | google, fonts, webfonts, webpack, plugin |

## Links

- npm: https://www.npmjs.com/package/google-fonts-webpack-plugin
- Repository: https://github.com/gabiseabra/google-fonts-webpack-plugin
- Issues: https://github.com/gabiseabra/google-fonts-webpack-plugin/issues
- npm.io page: https://npm.io/package/google-fonts-webpack-plugin

## Dependencies (4)

- [yauzl](https://npm.io/package/yauzl.md) ^2.8.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [node-fetch](https://npm.io/package/node-fetch.md) ^1.6.3
- [webpack-sources](https://npm.io/package/webpack-sources.md) ^0.2.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.4.4 (latest) — 2017-12-22
- 0.4.3 — 2017-09-20
- 0.4.2 — 2017-08-25
- 0.4.1 — 2017-07-03
- 0.4.0 — 2017-06-03
- 0.3.2 — 2017-05-19
- 0.3.1 — 2017-04-22
- 0.3.0 — 2017-04-13
- 0.2.0 — 2017-03-25
- 0.1.0 — 2017-03-24

## README

# Google Fonts Webpack Plugin

Download Google fonts to webpack build folder using [google-webfonts-helper](https://github.com/majodev/google-webfonts-helper) or use CDN to integrate with [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin).

---

## Install

```bash
npm install google-fonts-webpack-plugin
```

## Usage

`/webpack.config.js`
```js
const GoogleFontsPlugin = require("google-fonts-webpack-plugin")

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

## Options

```js
new GoogleFontsPlugin(options: Object)
```

|Name|Type|Default|Description|
|----|----|-------|-----------|
|fonts|`FontObject[]`|-|Configuration generated by [http://fontello.com](Fontello.com).
|name|`String`|`"fonts"`|Module name.
|filename|`String`|`"fonts.css"`|Css file name.
|path|`String`|`"font/"`|Relative path to fonts directory. If path is `undefined` fonts are not downloaded, the css file is generated with Google hosted font files.
|local|`Boolean`|`true`|Wether 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).
|formats|`Array`|`[ "eot", "woff", "woff2", "ttf", "svg" ]`|Font formats to download.
|apiUrl|`String`|`"https://google-webfonts-helper.herokuapp.com/api/fonts"`|google-webfonts-helper API url.


### FontObject

|Name|Type|Default|Description|
|----|----|-------|-----------|
|family|`String`|-|Font family.
|variants|`Array`|-|Font variants according	to google-webfonts-helper (e.g.: `[ "italic", "500", "700italic" ]`).
|subsets|`Array`|-|Font subsets according	to google-webfonts-helper (e.g.: `[ "latin", "greek" ]`).
|formats|`Array`|-|Font formats to download. Defaults to `options.formats`.

---
_Source: https://npm.io/package/google-fonts-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
