reduhq / a

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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"
    }
}

About


Languages

Language:CSS 45.9%Language:TypeScript 33.7%Language:JavaScript 11.1%Language:HTML 9.3%