/a

Primary LanguageCSS

a

How to deploy a ReactAPP on GitHub Pages

  1. Install gh-pages
npm install gh-pages --save-dev
  1. vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  base: "/el-nombre-de-tu-repositorio/",
});
  1. Add the next lines in the package.json
  • With predeploy we compile the application.
  • With deploy we deploy the site on github.
{
    "scripts":{
        "predeploy": "npm run build",
        "deploy": "gh-pages -d dist"
    }
}