• Stars
    star
    409
  • Rank 102,048 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A vite framework for building react app. Especially suitable for document site and demos/playgrounds of react components.

📘 vite-plugin-react-pages

npm package

vite-plugin-react-pages (vite-pages) is a React app framework powered by vite. It is very suitable for:

  • blog site
  • documentation site for your library or product
  • stories/demos/playgrounds for your React components or libraries (like storybook)

It provides many features that help developers build a React App quickly:

  • Fantastic development experience. Start the local development server in a blink, even when you have many pages. Hot module replacement works with React and Mdx, so you can get instant feedback when you edit your code.
  • Filesystem based routing. By following a simple filesystem routing convention, It is easy to create, locate and develop pages. You don't need to worry about routing configuration. For advanced users, you can tell vite-pages how to find page files, so that vite-pages can work with any project file structure.
  • Support Mdx. You can write content with either "normal React" or Mdx. Normal Reactjs is more flexible and composable. While Mdx is more readable and easier to edit. You can choose the proper format for your task. These formats can import each other like normal esModules.
  • Powerful theme customization. Vite-pages itself doesn't render any concrete DOM node. You can customize anything on the page with theme. It is easy to write a theme that is sharable and configurable. If you use typescript, the users of your theme will get type-check and intelliSense.
  • Automatic code splitting based on pages. Visitors don't need to download the whole app, they only load page data as needed.
  • Support static site generation out of the box. By pre-rendering your app into HTML at buildtime, users can see the content before any JS is loaded. With this feature, you can deploy your single page apps on GitHub Pages(which doesn't natively support single page apps).
  • Tools for Library documentation. Vite-pages provides some tools to reduce the maintenance costs for library authors and make their documents more easily to read.

Getting stated

Try it online on StackBlitz

You can play with these demo projects in your browser, without installing anything on your machine.

Initialize a demo project locally

  1. Initialize a vite-pages project (with npm 7+):
    • execute npm init vite-pages app-demo -- --template app to initialize an app project, or
    • execute npm init vite-pages library-demo -- --template lib to initialize a library project, or
    • execute npm init vite-pages library-monorepo-demo -- --template lib-monorepo to initialize a library project with monorepo setup.
    • If you are using npm 6.x, the extra double-dash before --template should be deleted. For example, npm init vite-pages app-demo --template app.
  2. npm install
  3. npm run dev and play with the local dev environment.
  4. npm run build.
  5. npm run ssr. You can disable javascript in your browser, to verify if it can still render.

Read the documentation

Read the documentation of vite-plugin-react-pages.

More Repositories

1

vite

Next generation frontend tooling. It's fast!
TypeScript
64,165
star
2

awesome-vite

⚡️ A curated list of awesome things related to Vite.js
JavaScript
13,046
star
3

docs-cn

Chinese translation of vitejs.dev
TypeScript
831
star
4

vite-plugin-react-swc

Speed up your Vite dev server with SWC
TypeScript
667
star
5

create-vite-app

Create a Vite-powered app in seconds!
JavaScript
572
star
6

vite-plugin-vue2

Vite plugin for Vue 2.7
TypeScript
515
star
7

vite-plugin-react

The all-in-one Vite plugin for React projects.
TypeScript
461
star
8

vite-plugin-vue

Vite Vue Plugins
TypeScript
371
star
9

vite-plugin-react-refresh

React Fast Refresh plugin for Vite
TypeScript
303
star
10

vite-plugin-basic-ssl

Basic https setup using an automatically generated self-signed certificate
TypeScript
230
star
11

vite-ecosystem-ci

Vite Ecosystem CI
TypeScript
219
star
12

rfcs

RFCs for substantial changes to Vite core
109
star
13

docs-ko

ViteJS 한글 공식 문서 (Korean translation of vitejs.dev)
TypeScript
101
star
14

vite-benchmark

Benchmark tool for vitejs/vite
JavaScript
79
star
15

docs-ja

Japanese translation of vitejs.dev
TypeScript
72
star
16

vite-plugin-vue2-jsx

Vite plugin for Vue 2.7 JSX support
TypeScript
54
star
17

release-scripts

@vitejs release scripts
TypeScript
35
star
18

docs-pt

Portuguese translation of vitejs.dev | Documentação da Vite em Português. 🇦🇴 🇧🇷 🇵🇹
29
star
19

docs-es

Traducción al español de la documentación de vitejs.dev
JavaScript
16
star
20

rfcs-bot

Automation of RFCs creation for vitejs/rfcs
TypeScript
13
star
21

.github

7
star
22

docs-de

🇩🇪 German translation of vitejs.dev | Die deutsche Übersetzung von vitejs.dev.
TypeScript
4
star