Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit output to only woff2? #238

Open
zoaha opened this issue Aug 20, 2024 · 3 comments
Open

Limit output to only woff2? #238

zoaha opened this issue Aug 20, 2024 · 3 comments

Comments

@zoaha
Copy link

zoaha commented Aug 20, 2024

Is it possible to limit the font outputs to ONLY woff2?

This works for only generating the .css instead of .less, .sass, ....:

	css: {
		output: "output",
		include: "\\.(css)$"
	}

Is there something similar for the font files?
I only need woff2.

Ideally generating:

@font-face {
  font-family: "myIcons";
  src: url("myIcons.woff") format("woff2")
}
@jaywcjlove
Copy link
Owner

@zoaha It may require a tool to remove it.

npm install --global del-cli
$ del --help

  Usage
    $ del <path|glob> …

  Options
    --force, -f    Allow deleting the current working directory and outside
    --dry-run, -d  List what would be deleted instead of deleting
    --verbose, -v  Display the absolute path of files and directories as they are deleted

  Examples
    $ del unicorn.png rainbow.png
    $ del "*.png" "!unicorn.png"

@amini-amr
Copy link
Contributor

@jaywcjlove I think it would be idead to add this option to the configuration instead of using another tool.

"excludeFormat": [
  "eot",
  "svg",
  "symbol.svg",
  "ttf",
  "woff"
]

@zoaha You can use node:fs unlink for now...

jaywcjlove added a commit that referenced this issue Nov 16, 2024
jaywcjlove added a commit that referenced this issue Nov 16, 2024
github-actions bot pushed a commit that referenced this issue Nov 16, 2024
@jaywcjlove
Copy link
Owner

svgtofont/src/index.ts

Lines 133 to 137 in 9eeeb3c

/**
* You can configure which font files to exclude from generation. By default, all font files will be generated.
* https://github.com/jaywcjlove/svgtofont/issues/238
*/
excludeFormat?: Array<"eot" | "woff" | "woff2" | "ttf" | "svg" | "symbol.svg">;

I have added this setting and updated it to v6.1.0. @amirrezamini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants