Giter Site home page Giter Site logo

lf-task-shop's Introduction

vite 快速发布项目在Github pages

配置

vite.config.js

import { defineConfig } from 'vite';
export default defineConfig({
  base: '/lf-task-shop/',
});

安装插件 npm install gh-pages

package.json

  "scripts": {
    "dev": "vite --open",
    "start": "vite --open",
    "host": "vite --open --host",
    "build": "vite build",
    "preview": "vite preview",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d dist",
  }

运行

  1. 创建一个新分支:git checkout -b gh-pages,注意,分支名必须为gh-pages
  2. 将分支push到仓库:git push -u origin gh-pages
  3. 切换到主分支: git checkout main
  4. 依次运行preview predeploy deploy 三个script

Github 相关

img.png

  1. 打开对应仓库的setting
  2. 点击左边的 pages
  3. 切换分支到 gh-pages
  4. 需要等一段事件 刷新网页后github将分配网址给你

lf-task-shop's People

Contributors

akechiz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.