I want to set up my custom domain for my gitlab page
I set up my vuejs project as with .gitlab-ci.yml
pages:
image: node:latest
stage: deploy
script:
- npm install --progress=false
- npm run build
- rm -rf public
- mkdir public
- cp -r dist/* public
artifacts:
expire_in: 1 day
paths:
- public
only:
- master
and I added a vue.config.js
file containing
module.exports = module.exports = {
publicPath: process.env.NODE_ENV === "production" ? "/<ProjectName>/" : "/",
};
Further I was able to set up the my custom domain following the this guide.
my project page is opening fine at https://<userName>.gitlab.io/<ProjectName>/
but when I use my custom domain <myDomain>.com
the page is blank. When I inspect the page
I see the following message
Refused to apply style from
'https://<myDomain>.com/<ProjectName>/css/app.a4f1ea2f.css'
because its MIME type ('text/html') is not a
supported stylesheet MIME type, and strict MIME checking is enabled.
now when I open the site without the project name https://<myDomain>.com/css/app.a4f1ea2f.css
.
the content of the compressed css is displayed.
when I take out publicPath: process.env.NODE_ENV === "production" ? "/<ProjectName>/" : "/",
then https://<myDomain>.com
works but https://<userName>.gitlab.io/<ProjectName>/
does not work anymore.
Therefore I assume there is an issue with the path. Namely the <ProjectName>
causes most likely the problem. How do I set the page correctly? How can I use both domain?