Open wmertens opened 8 years ago
Another option would be to also include the configured public path into the url…
IMHO, assets should be loaded without path, since they will be in the same location as the index.html file.
We had that, but the problem then is that you have to go to /dest/
(notice the trailing slash), otherwise the assets will refer to the root domain. I'm about 99% sure that we'd get tons of bug reports about that, so I fixed it by prepending the dest option.
Another option would be to also include the configured public path into the url…
That sounds a lot more reasonable. :+1: Shouldn't be too hard either, we have to pass it to the ReactPlugin frontend.js and then merge the dest option with the public path.
The trailing / could be fixed by passing staticOptions: {redirect: true}
to the webpack-dev-server.
Also, a bit of javascript before the main js loading could check for the url matching /(index.html)?
and if not, redirecting.
Our webpack assets are generally under
/_assets
so that they don't interfere with HTML5 URL rewrites.This means that the
http://.../carte-blanche
url is really athttp://.../_assets/carte-blanche
. Carte Blanche refers to its assets by absolute path, so that doesn't work. Specifying adest
option just replaces thecarte-blanche
part, not the prefix.IMHO, assets should be loaded without path, since they will be in the same location as the
index.html
file.