Skip to content

developit/nextjs-preact-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Preact example

This is a fully working example of Next.js 9.5 running on Preact instead of React.

This reduces the base JavaScript weight of pages to ~22kB.

🔭 In the future, this can be even smaller with some additional Webpack optimizations.

How to use

Clone this repo and run npm install:

git clone https://github.com/developit/nextjs-preact-demo.git
cd nextjs-preact-demo
npm install

There are three commands available:

# start a development server:
npm run dev

# create a production build:
npm run build

# start a production server:
npm start

How does it work?

The example takes advantage of npm/yarn aliases, which essentially allow installing preact/compat at node_modules/react.

Here's how this example repo was set up:

About

Next.js 9.3 + Preact = 21kB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published