1

in order to serve all of my resources from the same server, i would like to bundle the fonts that the application is using by either:

  1. include the fonts within the generated bundle file (e.g. app.js), or by
  2. downloading the fonts and modify the generated bundle file to refer to the fonts locally relatively

i tried to do so by file-loader and url-loader for webpack, but when i open the generated html file (e.g. index.html) in the browser, requests for google fonts are shown in the network monitor (yes, google fonts are used and credits will be given, but would like to have the fonts served from the server which runs the app), and i would not like to see such requests.

for instance, assume that my *.scss files include the @import url('...') statement, is there any plugin\loader for webpack that will recursively download all the resources and will bundle them (like mentioned above)?

p.s. although i came across this answer

Both loaders will pack url() statements. However, they both will only work if the URL is a relative URL

i am still interested in more up to date answer.

Mr.
  • 9,429
  • 13
  • 58
  • 82

0 Answers0