Skip to content

Commit 1546ae6

Browse files
9renpotoTimer
authored andcommitted
chore: Upgrade Preact (vercel#544)
* chore: Upgrade preact * fix: remove unnecessary dependencies * Added preact-ssr-prepass
1 parent acb46e7 commit 1546ae6

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

packages/next-preact/alias.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const path = require('path')
21
const moduleAlias = require('module-alias')
32

43
module.exports = () => {
5-
moduleAlias.addAlias('react', path.join(__dirname, './preact-compat.js'))
6-
moduleAlias.addAlias('react-dom', 'preact-compat')
4+
moduleAlias.addAlias('react', 'preact/compat')
5+
moduleAlias.addAlias('react-dom', 'preact/compat')
6+
moduleAlias.addAlias('react-ssr-prepass', 'preact-ssr-prepass')
77
}

packages/next-preact/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const path = require('path')
2-
31
module.exports = (nextConfig = {}) => {
42
return Object.assign({}, nextConfig, {
53
webpack(config, options) {
@@ -14,10 +12,10 @@ module.exports = (nextConfig = {}) => {
1412
}
1513

1614
config.resolve.alias = Object.assign({}, config.resolve.alias, {
17-
react$: path.join(__dirname, './preact-compat.js'),
18-
'react-dom$': 'preact-compat',
19-
react: path.join(__dirname, './preact-compat.js'),
20-
'react-dom': 'preact-compat'
15+
react$: 'preact/compat',
16+
'react-dom$': 'preact/compat',
17+
react: 'preact/compat',
18+
'react-dom': 'preact/compat'
2119
})
2220

2321
if (typeof nextConfig.webpack === 'function') {

packages/next-preact/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
"license": "MIT",
66
"repository": "zeit/next-plugins",
77
"peerDependencies": {
8-
"preact": "^8.2.0",
9-
"preact-compat": "^3.17.0",
10-
"preact-context": "^1.1.3"
8+
"preact": "^10.0.0"
119
},
1210
"dependencies": {
1311
"module-alias": "2.0.6"

packages/next-preact/preact-compat.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/next-preact/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Use [preact](https://preactjs.com/) with [Next.js](https://github.com/zeit/next.
55
## Installation
66

77
```
8-
npm install --save @zeit/next-preact preact preact-compat preact-context
8+
npm install --save @zeit/next-preact preact preact-ssr-prepass
99
```
1010

1111
or
1212

1313
```
14-
yarn add @zeit/next-preact preact preact-compat preact-context
14+
yarn add @zeit/next-preact preact preact-ssr-prepass
1515
```
1616

1717
## Usage

0 commit comments

Comments
 (0)