Add option to specyfy path where file should save
sxzctzppyw opened this issue ยท 5 comments
Hi,
Is it possible to specify the path where the file should be saved?
Hello again, the plugin saves to webpacks output directory. In past versions, there was an option to specify path yourself, but I dropped it, because it seemed people put the same output path... Can you please explain to me your usecase? I'll consider it :)
Hi, I have the same request.
Currently in our site we use 2 fonts and google already evaluates them as performance heavy on load times. The design team wants to use a particular third font on a specific page, however adding it to the plugin's config will add it globally to my site, hindering performance not only on said page, but also on all other pages.
Adding this functionality would isolate the drop in performance to only a single page.
Thank you.
Hey, @thomasryu! I've just tried with the new version, you can specify filename
in options with directory, eg: filename: 'fonts/[name].[chunkhash].css'
and webpack would create the directory relative to output path and save the files to it... Is that ok for your use case or do you need completely custom directory?
(my case with gzip and brotli plugins)
Have you considered using the new text
option? It's a google fonts feature that only generates font files with the characters you specify, it can dramatically reduce filesize. Also, I think long term caching would do wonders for your performance. I personaly save my generated fonts to localstorage on first load and restore them on reloads... :)
Great, cheers ๐
I'm closing this for the time being, reopen please if you have any further ideas...