dennisreimann / uiengine

Workbench for UI-driven development
https://uiengine.uix.space/
MIT License
366 stars 25 forks source link

Assets path is not unified #37

Closed ChrisGitIt closed 5 years ago

ChrisGitIt commented 5 years ago

Describe the bug Hi, I just created a standalone index.html (npx uiengine build) and threw it onto my server under /doc.

Unfortunately, i could not display my documentation. I think its mainly because the path that is used for "_assets" is different on several occasions (sometime with /_assets and sometimes without

To Reproduce Steps to reproduce the behavior:

  1. "npx uiengine build" on any available project
  2. Put the "/dist/*" contents onto a server domain subdirectory (like /test/)
  3. Open your domain.tld/test/
  4. See error

Expected behavior I would like the complete working documentation here. Instead only some parts get loaded due to JS and CSS loading errors (try to load domain.tld/_assets/ instead of domain.tld/test/_assets/

Screenshots imagine a white page with white letters and a white logo over white clouds

dennisreimann commented 5 years ago

Hey Chris, did you try using the base option? In your case:

ui: {
  base: "/doc/"
}
dennisreimann commented 5 years ago

Does this work for you so that we can close this issue?

ChrisGitIt commented 5 years ago

Thanks for your help. This works! Sorry for not reading the docs for this hint. Maybe it would be possible to get rid of this config if the docs js/css files are all loaded relativ ... but I'm unsure if this will break the SPA when reloading on a subpage (= url would be resolved differently).

dennisreimann commented 5 years ago

Yep, that‘s why it‘s implemented with absolute links.

Regarding you mot having come across this: No worries, I admit it‘s too hidden to find it. I‘ll try to come up with a better/more redundant way of explaining this feature.