Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Commit

Permalink
chore: Upgrade Preact (#544)
Browse files Browse the repository at this point in the history
* chore: Upgrade preact

* fix: remove unnecessary dependencies

* Added preact-ssr-prepass
  • Loading branch information
9renpoto authored and Timer committed Oct 20, 2019
1 parent acb46e7 commit 1546ae6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
6 changes: 3 additions & 3 deletions packages/next-preact/alias.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path')
const moduleAlias = require('module-alias')

module.exports = () => {
moduleAlias.addAlias('react', path.join(__dirname, './preact-compat.js'))
moduleAlias.addAlias('react-dom', 'preact-compat')
moduleAlias.addAlias('react', 'preact/compat')
moduleAlias.addAlias('react-dom', 'preact/compat')
moduleAlias.addAlias('react-ssr-prepass', 'preact-ssr-prepass')
}
10 changes: 4 additions & 6 deletions packages/next-preact/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const path = require('path')

module.exports = (nextConfig = {}) => {
return Object.assign({}, nextConfig, {
webpack(config, options) {
Expand All @@ -14,10 +12,10 @@ module.exports = (nextConfig = {}) => {
}

config.resolve.alias = Object.assign({}, config.resolve.alias, {
react$: path.join(__dirname, './preact-compat.js'),
'react-dom$': 'preact-compat',
react: path.join(__dirname, './preact-compat.js'),
'react-dom': 'preact-compat'
react$: 'preact/compat',
'react-dom$': 'preact/compat',
react: 'preact/compat',
'react-dom': 'preact/compat'
})

if (typeof nextConfig.webpack === 'function') {
Expand Down
4 changes: 1 addition & 3 deletions packages/next-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"license": "MIT",
"repository": "zeit/next-plugins",
"peerDependencies": {
"preact": "^8.2.0",
"preact-compat": "^3.17.0",
"preact-context": "^1.1.3"
"preact": "^10.0.0"
},
"dependencies": {
"module-alias": "2.0.6"
Expand Down
6 changes: 0 additions & 6 deletions packages/next-preact/preact-compat.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/next-preact/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Use [preact](https://preactjs.com/) with [Next.js](https://github.com/zeit/next.
## Installation

```
npm install --save @zeit/next-preact preact preact-compat preact-context
npm install --save @zeit/next-preact preact preact-ssr-prepass
```

or

```
yarn add @zeit/next-preact preact preact-compat preact-context
yarn add @zeit/next-preact preact preact-ssr-prepass
```

## Usage
Expand Down

0 comments on commit 1546ae6

Please sign in to comment.