nextjs-preact-demo

Next.js 9.3 + Preact = 21kB

  • Owner: developit/nextjs-preact-demo
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Preact example

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

This reduces the base JavaScript weight of pages to 21kB.

? 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:

Main metrics

Overview
Name With Ownerdevelopit/nextjs-preact-demo
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:
所有者活动
Created At2020-02-02 17:32:10
Pushed At2020-11-02 07:55:38
Last Commit At2020-11-02 08:55:35
Release Count0
用户参与
Stargazers Count384
Watchers Count12
Fork Count23
Commits Count30
Has Issues Enabled
Issues Count25
Issue Open Count4
Pull Requests Count8
Pull Requests Open Count0
Pull Requests Close Count2
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private