Closed Cyprias closed 3 years ago
@Cyprias It sounds like you're basically asking to prefix the assets but not the output content. Hard to follow.
I haven't used Gitlab's hosting process but it sounds like it needs some nonconventional deploy settings. I know things work well with pages.dev, netlify, s3, etc. Sorry I can't be of more help.
I think that's accurate. The html needs to prefix assets/links to deal with GL adding the project's name to the url.
So that /assets/blaw.js
becomes /some_prefix/assets/blaw.js
.
In GL's sapper example, it uses npm run export -- --basepath $CI_PROJECT_NAME
to provide the project's name to sapper's export script. Is there a similar type of parameter that can be provided to elder's build script?
I got GitLab to build the project using this config.
.gitlab-ci.yml
Gitlab Pages deploys projects as
http://username.gitlab.io/project-name/
. When visitinghttps://cyprias.gitlab.io/elderjs-app/
, the project's index.html shows up without any of the css and links point tohttp://cyprias.gitlab.io/xyz
instead ofhttp://cyprias.gitlab.io/elderjs-app/xyz
.When setting
settings.prefix
toelderjs-app
, thehttp://cyprias.gitlab.io/elderjs-app/
link becomes a 404 error. Instead the webpage is accessible athttps://cyprias.gitlab.io/elderjs-app/elderjs-app/
. The index.html is shown but without the css again as the css points tohttps://cyprias.gitlab.io/elderjs-app/_elderjs/assets/svelte-9e1a324b.css
when it's now athttps://cyprias.gitlab.io/elderjs-app/elderjs-app/_elderjs/assets/svelte-9e1a324b.css
.Setting
settings.origin
tohttps://cyprias.gitlab.io
orhttps://cyprias.gitlab.io/elderjs-app
doesn't seem to have any effect, with or without prefix having the project's name in it or not.Any assistance would be greatly appreciated.