0

Using Webpack in the project for compiling modules. One of them (Bootswatch) overrides a lot of Bootstrap to apply a theme.

Right at the beginning of the _bootswatch.scss it has:

$web-font-path: "https://fonts.googleapis.com/css?family=Lato:400,700,400italic" !default;
@import url($web-font-path);

This import is always run, resulting in a request that need not happen (as the font is overriden to "Segoe UI" or something, which is usually installed and does not need to be downloaded.

How can I ensure the url($...) never gets done?

I've tried setting it to false, '' and "" and tried searching for it, but keep getting things about changing it instead of disabling it. Also did not find how to disable it in the docs

These changes were done like so:

@import "~bootswatch/dist/darkly/variables";

$web-font-path: '' !important;

The changes all result in variations on:

 WAIT  Compiling...                                                                                                                                                                                                                            2:24:33 PM

 WARNING  Compiled with 1 warnings                                                                                                                                                                                                             2:24:35 PM

 warning  in ./assets/css/admin/admin.scss

Module Warning (from ./node_modules/css-loader/dist/cjs.js):
Warning

(1:1) Unable to find uri in '@import url("" !important)' // insert other tried values here

It's the following request I want to get rid off:

some requests

rkeet
  • 3,406
  • 2
  • 23
  • 49

1 Answers1

0

I needed to accomplish the exact same thing.

This answer helped me: Bootstrap CSS without Google Fonts 2 (Bootswatch)

Specifically, I used double-quotes without !important, and set it before my imports:

$web-font-path: "";
@import "~bootswatch/dist/darkly/variables";
@import "~bootstrap/scss/bootstrap";
HDB2000
  • 36
  • 2