Roots Discourse

Fonts + background image paths work at proxyUrl, break at devUrl


#1

Hey guys,

When I yarn start my fonts show up just fine at my proxyUrl. When I run ‘yarn build’ , or yarn build:production, my font paths and CSS background-image urls are broken. I’ve been looking at this too long and I’m guessing I’m doing something really obviously stupid.

Here is my assets/config.json:

{
  "entry": {
    "main": [
      "./scripts/main.js",
      "./styles/main.scss"
    ],
    "customizer": [
      "./scripts/customizer.js"
    ]
  },
  "publicPath": "/wp-content/themes/eightytwenty",
  "devUrl": "http://localhost:8888/8020/kara_urie_lott",
  "proxyUrl": "http://localhost:3000/8020/kara_urie_lott",
  "cacheBusting": "[name]_[hash:8]",
  "watch": [
    "app/**/*.php",
    "config/**/*.php",
    "resources/views/**/*.php"
  ]
}

…and this image shows my proxyUrl and the font path it’s loading:

…and this image show my devUrl and the font path it’s trying to load:

As I look through the docs and community forum I keep seeing answers to similar problems such as prepending a backslash to the publicPath. These solutions don’t work for me.

Any help would be so greatly appreciated, thanks in advance.


#2

This should ideally be just a local testing domain and not a domain + folders


#3

Thanks for the reply @benword, I ended up moving the folder path to the publicUrl and it worked locally, and then just removed it on my production server.


#4

Hey, @caitlindev! This might help you with the difference between your dev and production environments. :wink: