In the documentation for the theme the advice is to use relative paths for assets in css, like so:
> .brand {
> background: url(../images/logo.svg);
> }
In my files I have added trees.svg into the /resources/assets/images/ folder and have tried this css:
header{ background-image: url(../images/trees.svg); }
But I get the following error:
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Object.relative (path.js:1162:5)
at Object.loader (/Users/naomispirit/Websites/xxxx/wp-content/themes/xxx/node_modules/file-loader/dist/index.js:78:72)
at Object.module.exports (/Users/naomispirit/Websites/xxx/wp-content/themes/xxx/node_modules/url-loader/index.js:37:25)
ERROR in ./resources/assets/images/trees.svg
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Object.relative (path.js:1162:5)
at Object.loader (/Users/xxx/Websites/xxx/wp-content/themes/xxx/node_modules/file-loader/dist/index.js:78:72)
at Object.module.exports (/Users/xxx/Websites/xxx/wp-content/themes/xxx/node_modules/url-loader/index.js:37:25)
It compiles properly only if I use a file path from the theme root to the dist folder “/wp-content/themes/xxx/dist/” but I am assuming this is not the right thing to do since it’s not what’s in the documentation.
In config.json I have the public path set:
"publicPath": "/wp-content/themes/xxx",
Have I got some setting somewhere wrong? Am very new to this theme and this way of working so may of course just be something very basic I’ve done incorrectly! Help appreciated!