预装 Vite Plugin PWA,用于生成 PWA 的 manifest JSON
PWA-Vite-React-Boilerplate — Vite 启动器模板
作者 MengLinMaker
基于 Vite、React 与 TypeScript 的可安装 PWA 启动模板,预置 Vite Plugin PWA、Sass 与 GitHub Actions 工作流。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 2
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
React 配合 TypeScript,构建时进行类型检查
内置 Sass 作为 CSS 预处理器,可通过 npm uninstall sass 移除
提供 GitHub Actions 工作流,包含持续集成与 CodeQL 分析
提供 dev、build、preview 三条 Vite 命令行脚本
模板详细介绍
这是一个面向渐进式 Web 应用(PWA)的启动模板,技术栈为 Vite + React + TypeScript。仓库已预装 Vite Plugin PWA,用于生成 PWA 所需的 manifest JSON;样式层使用 Sass 作为 CSS 预处理器;同时附带 GitHub Actions 工作流,用于持续集成与 CodeQL 分析。
使用方式上,模板提供从 GitHub 生成仓库的入口,随后通过 Vite 命令行脚本进行本地开发(npm run dev)、构建生产文件(npm run build,输出到 dist 目录)以及本地预览生产构建(npm run preview)。README 明确指出开发模式下不包含 PWA 功能,构建时若存在 TypeScript 错误会中止编译。
许可方面,仓库采用 MIT 许可,允许免费使用、修改、商用与分发该版本代码,分发时需保留版权声明与许可声明;演示图片、字体、图标等第三方素材以及域名、托管等外部服务需另行核对各自许可与费用。
适合你的项目吗?
适用场景
- 从模板生成仓库,快速搭建可安装的 PWA 项目骨架
- 在 React + TypeScript 项目中引入 PWA manifest 与安装能力
- 需要 Sass 预处理样式并希望开箱即用的前端项目
- 希望借助 GitHub Actions 做持续集成与代码扫描的仓库
适合人群
- 使用 Vite 与 React 开发 PWA 的前端开发者
- 需要 TypeScript 类型检查与 Sass 支持的项目
- 希望以 GitHub 模板方式初始化仓库并接入 CI 的团队
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
通过 GitHub 模板生成仓库后,使用 git clone 拉取到本地
- 2
开发使用 npm run dev,但开发模式下没有 PWA 功能
- 3
构建使用 npm run build,存在 TypeScript 错误会中止编译,产物默认输出到 dist 目录
- 4
本地预览生产构建使用 npm run preview
- 5
npm 可替换为 yarn 或 pnpm,具体脚本见 package.json 的 scripts 段
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 开发模式(npm run dev)下不提供 PWA 功能,无法在本地开发时测试安装、离线缓存等 PWA 行为,需先执行生产构建(npm run build)并预览才能验证 PWA 相关能力。
- 构建时若存在 TypeScript 类型错误,编译会被中止,无法产出 dist 目录文件;使用前需保证代码通过类型检查。
- Sass 为预装依赖,若不使用 Sass 预处理样式,需手动执行 npm uninstall sass 移除,否则会保留该依赖。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
There is no PWA functionality in development mode.
README 原文
Ensure there are no TypeScript errors, otherwise complilation will be aborted.
README 原文
https://github.com/MengLinMaker/PWA-Vite-React-Boilerplate/blob/main/LICENSE.mdhttps://github.com/MengLinMaker/PWA-Vite-React-Boilerplate/blob/main/README.mdTo uninstall, type: ```npm uninstall sass``` in terminal.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-03。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 86 / 100
- 技术栈
- Vite · React
- 网站类型
- 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2025-03-26
- 截图检查日期
- 2026-10-03
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Vite。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 2df9cc70ab404afbea3fdecb80129da63c905a9c154c3243f7383babb4759f0e
2026-10-03T02:49:29.447Z
来源文件 / 仓库<h1 align="center">
PWA Vite React Boilerplate
</h1>
<div flex align="center">
<img alt="GitHub" src="https://img.shields.io/github/license/menglinmaker/PWA-Vite-React-Boilerplate?style=flat-square">
<img src="https://img.shields.io/github/languages/code-size/menglinmaker/PWA-Vite-React-Boilerplate?style=flat-square">
<img src="https://img.shields.io/github/workflow/status/menglinmaker/PWA-Vite-React-Boilerplate/Continuous Integration?style=flat-square">
<img src="https://img.shields.io/website?down_color=red&down_message=offline&up_color=success&up_message=online&url=https://menglinmaker-midi-virtual-piano.netlify.app/&style=flat-square">
<img src="https://img.shields.io/github/forks/menglinmaker/PWA-Vite-React-Boilerplate?label=forks&style=flat-square">
</div>
<div> </div>
<div align='center'>
<a href='https://pwa-vite-react-boilerplate.netlify.app/'>
<img width='480' src='https://user-images.githubusercontent.com/39476147/184496091-35faa26b-4591-45bc-90cb-6a215f600e2d.png'/>
</a>
</div>
<div> </div>
<div flex align='center'>
<img height=30 src="https://img.shields.io/badge/Vite-B73BFE?style=for-the-badge&logo=vite&logoColor=FFD62E" />
<img height=30 src="https://img.shields.io/badge/React-20232a?style=for-the-badge&logo=react&logoColor=61DAFB" />
<img height=30 src="https://img.shields.io/badge/Sass-CC6699?style=for-the-badge&logo=sass&logoColor=white" />
<img height=30 src="https://img.shields.io/badge/GitHub_Actions-2088FF?style=for-the-badge&logo=github-actions&logoColor=white" />
</div>
<h2 align='center'> ->> <a href='https://pwa-vite-react-boilerplate.netlify.app/'> Demo Page </a> <<- </h2>
<div> </div><div> </div><div> </div>
# Boilerplate Techstack
This boilerplate is already preinstalled with:
* *[Vite Plugin PWA](https://vite-plugin-pwa.netlify.app/)* to generate the manifest JSON for *[progressive web app (PWA)](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps)*.
* *[Vite.js](https://vitejs.dev/)* frontend tooling to build for production.
* *[React.js](https://reactjs.org/)* with TypeScript support.
* *[Sass](https://sass-lang.com/)* CSS preprocessor. To uninstall, type: ```npm uninstall sass``` in terminal.
* *[Github Action](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions)* for continuous integration and codeql analysis.
<div> </div><div> </div><div> </div>
# How To Use
## Generate GitHub repository
1. Generate your repository from this template: *[Click Here](https://github.com/MengLinMaker/PWA-Vite-React-Boilerplate/generate)*
2. Clone code to your to remote repository: `git clone https://github.com/user-name/repository-name`
Note: supply your GitHub user-name and repository-name.
## Development
The following terminal commands are from *[Vite.js command line interface](https://vitejs.dev/guide/#command-line-interface)*. Also check the *[package.json](https://github.com/MengLinMaker/PWA-Vite-React-Boilerplate/blob/main/package.json)* file "scripts" section for all command line scripts.
Note: *[npm](https://www.npmjs.com/)* can also be replaced with *[yarn](https://yarnpkg.com/)* or *[pnpm](https://pnpm.io/)*...
### Run development website locally
```
npm run dev
```
* There is no PWA functionality in development mode.
### Build production files - to "dist" folder
```
npm run build
```
* Ensure there are no TypeScript errors, otherwise complilation will be aborted.
* Build files will be placed in the "dist" folder by default.
* To change build folder, add this line to *[vite.config.ts](https://github.com/MengLinMaker/PWA-Vite-React-Boilerplate/blob/main/vite.config.ts)* `defineConfig`:
```javascript
build: {
outDir: './build-directory'
},
```
### Run production build website locally
```
npm run preview
```
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

react-starter-kit
Modern React starter kit with Bun, TypeScript, Tailwind CSS, tRPC, Stripe, and Cloudflare Workers. Production-…
Vite · SaaS

cove
The Cove Stack: 🏝️ minimal TanStack Start template with Vite+, Better Auth, Drizzle ORM, shadcn/ui
Vite · SaaS

vite-react-boilerplate
A production ready, scalable starter template for Vite + React
Vite · 启动器

react-vite-admin
This Starter utilizes React, Recoil, React Query, React Hooks, Typescript, Axios And Vite. 全新技术栈的后台管理系统
Vite · 后台

typescript-react_best_practices-vite_template
<⚡⚛️> Start your React project with Vite following code best practices (TypeScript, Linting, testing, CI/CD…)
Vite · 启动器

cloudflare-starter-kit
Template (boilerplate) repository for scaffolding Cloudflare Workers projects
Vite · 启动器
