I’m having an issue with images assets not showing on yarn build:production while everything runs smoothly on yarn start. Is there something wrong with my virtualhost or config.json ?
Ahh I see, so that would be the correct behaviour, urls are relative on a build so your configuration appears to be setup correctly in terms of the sage theme. If for example you ran yarn run build:production and then sent your theme to production that URL would change based on where the theme is loaded from, based on compiled files having relative URLs.
My initial port of call would be to investigate your development machine hosts file, ensuring it correctly handles angely.local and also confirm that WordPress has the correct site URL in the WordPress dashboard.
Are you using the full roots stack for your local environment? I.e. Bedrock and Trellis?
No i’m not using Bedrock and Trellis, i’m doing it the old way with Wamp. I know I should go for those time-saving tools asap but I haven’t learned them yet, so maybe in a near future
My virtualhost is set up like this :
(httpd-vhosts.conf)
# angely.local
<VirtualHost *:80>
ServerName angely.local
DocumentRoot “d:/wamp/www/angely”
<Directory “/”>
Deny from all
Allow from 127.0.0.1
If you’d like your URL to read http://angely.local/* locally you will need to update your URL in the WordPress Dashboard to http://angely.local. You do not need to provide the subfolder in this URL as your vhosts config is automatically handling that via DocumentRoot “d:/wamp/www/angely”
If you’d like your URL to read http://angely.local/angely/* you would need to set your WordPress Dashboard URL to be http://angely.local/angely. You would then need to enable mod_rewrite (I assume this is already enabled to handle pretty permalinks). And in your htaccess file handle the subfolder rewrite. For example: