google-fonts-webpack-plugin

  • 所有者: gabiseabra/google-fonts-webpack-plugin
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Google Fonts Webpack Plugin

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


Install

npm install google-fonts-webpack-plugin

Usage

/webpack.config.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

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`.

主要指標

概覽
名稱與所有者gabiseabra/google-fonts-webpack-plugin
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證
所有者活动
創建於2017-03-24 21:47:52
推送於2021-08-05 10:07:14
最后一次提交2017-12-22 16:19:11
發布數9
最新版本名稱v0.4.4 (發布於 2017-12-22 18:11:57)
第一版名稱v0.2.0 (發布於 2017-03-25 19:40:08)
用户参与
星數132
關注者數9
派生數44
提交數30
已啟用問題?
問題數29
打開的問題數19
拉請求數3
打開的拉請求數3
關閉的拉請求數2
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?