My directory structure is as follows:
example/
├── css/
│ ├── styles.css
├── img/
│ ├── background.jpg
└── src/
├── scss/
│ ├── app.scss
└── app.js
When I specify an absolute URL for a background image in app.scss
, such as background-image: url("/img/background.jpg");
, it will work just fine.
However, if I specify a relative URL, such as background-image: url("../img/background.jpg");
, the build process will fail.
Is there a way to force Webpack to ignore such errors?
If it would just proceed to build my styles.css
file, it would of course properly load the background via the relative URL, but I just can't ever get it that far.
It is important to resolve this because otherwise you are forced to deploy websites into the webroot and cannot use subdirectories as the absolute URL would break on production.
Thanks for your help.