I'm a beginner and I'm learning javascript and vueJs.
i want to deploy my first vuejs app but it's impossible. I lost hours but I can't do it anymore. I have to ask for help.
When i deploy, i have a blank page.
My vue.config.js:
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({ transpileDependencies: true,
publicPath:process.env.NODE_ENV === 'production'
?'/My-repo/'
: '/'
})
And My deploy.bat file:
# abort on errors
set -e
# build
npm run build
# navigate into the build output directory
cd dist
# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME
git init
git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git main
# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f git@github.com:myUsername/myRepository.git master:gh-pages
cd -
thank you for your help.
Thanks for your answers guys.
If it can help others.
On Ubuntu, with VSCode I created the deploy.sh file:
#!/usr/bin/env sh
# abort on errors
set -e
# build
npm run build
# navigate into the build output directory
cd dist
git init
git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
cd -
then I entered following code in terminal of vscode:
chmod +x deploy.sh
then
ssh-keygen -t ed25519 -C "<Your@email.com>"
Then go to package.json and add "deploy":"sh deploy.sh" in scripts:
"scripts":{
"deploy":"sh deploy.sh"
},
then in Terminal:
npm run deploy
In github go to:
Thank you everyone and have a nice day. And sorry for my poor English ;)