smashingboxes / web-boilerplate

A template for new front-end projects.
3 stars 2 forks source link

Add publicPath key and value to output in webpack config #69

Closed leeallen337 closed 6 years ago

leeallen337 commented 6 years ago

Why?

Not having publicPath equal to '/' would break when trying to go to nested routes

What Changed?

dkniffin commented 6 years ago

I saw the conversation in the engineers slack channel, but I'm still not sure I understand what this does. Can you break it down for me?

leeallen337 commented 6 years ago

@dkniffin From what I recall when I first encountered it when I had to make this change on Stilio here. When you try and do a refresh on a nested route, say locahost:8080/users/5, instead of looking for the bundle.js with the path of locationhost:8080/ it will by default look for it in the nested route (e.g. locahost:8080/users/

See this comment.

leeallen337 commented 6 years ago

@dkniffin Also I think this isn't being used on Plant Tour and, if I had to guess, it's because you're using the hash router instead of the browser router.