New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@davidbailey00/next-preact

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@davidbailey00/next-preact

Use [preact](https://preactjs.com/) with [Next.js](https://github.com/zeit/next.js)

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Next.js + preact

Use preact with Next.js

Installation

npm install --save @zeit/next-preact preact preact-compat preact-context

or

yarn add @zeit/next-preact preact preact-compat preact-context

Usage

Create a next.config.js in your project

// next.config.js
const withPreact = require('@zeit/next-preact')
module.exports = withPreact({
  /* config options here */
})

Then create a server.js

// server.js
require('@zeit/next-preact/alias')()
const { createServer } = require('http')
const next = require('next')


const app = next({ dev: process.env.NODE_ENV !== 'production' })
const port = process.env.PORT || 3000
const handle = app.getRequestHandler()

app.prepare()
.then(() => {
  createServer(handle)
  .listen(port, () => {
    console.log(`> Ready on http://localhost:${port}`)
  })
})

Optionally you can add your custom Next.js configuration as parameter

// next.config.js
const withPreact = require('@zeit/next-preact')
module.exports = withPreact({
  webpack(config, options) {
    return config
  }
})

FAQs

Package last updated on 02 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc