Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
next-inferno
Advanced tools
Use Inferno :fire: with Next.js to get even faster :zap: rendering.
npm install --save next-inferno inferno inferno-compat inferno-clone-vnode inferno-create-class inferno-create-element
or
yarn add next-inferno inferno inferno-compat inferno-clone-vnode inferno-create-class inferno-create-element
Create a next.config.js
in your project
// next.config.js
const withInferno = require('next-inferno')
module.exports = withInferno()
Then create a server.js
// server.js
require('next-inferno/alias')()
const { createServer } = require('http')
const next = require('next')
const app = next({ dev: process.env.NODE_ENV !== 'production' })
const handle = app.getRequestHandler()
const port = process.env.PORT || 3000
app.prepare()
.then(() => {
createServer(handle)
.listen(port, () => {
console.log(`> Ready on http://localhost:${port}`)
})
})
Then add or change "scripts" section of your package.json
:
...
"scripts": {
"dev": "node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
...
Optionally you can add your custom Next.js configuration as parameter
// next.config.js
const withInferno = require('next-inferno')
module.exports = withInferno({
webpack(config, options) {
return config
}
})
Looking for TypeScript support? Just follow that easy steps to use it in your Next projects:
typescript
and @zeit/next-typescript
(aslo you can use next-awesome-typescript
for perfomance reasons):npm install --save typescript @zeit/next-typescript
or
yarn add typescript @zeit/next-typescript
next.config.js
:// next.config.js
const withInferno = require('next-inferno')
const withTypescript = require('@zeit/next-typescript')
module.exports = withInferno(withTypescript())
{
"compileOnSave": false,
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"jsx": "preserve",
"allowSyntheticDefaultImports": true,
"allowJs": true,
"moduleResolution": "node",
"sourceMap": true,
"removeComments": false,
"baseUrl": ".",
"lib": [
"dom",
"es2015",
"es2016"
]
}
}
By default, next's TypeScript plugin only transpiles your code without type checks. It means that you can see type errors only in your IDE or code editor (for example VS Code can do it out of the box).
If you want to enable typechecks on compile to see type errors in terminal or browser, make the following changes in 'next.config.js':
// next.config.js
const withInferno = require('next-inferno')
const withTypescript = require('@zeit/next-typescript')
module.exports = withInferno(withTypescript({
webpack(config, options) {
return config
},
typescriptLoaderOptions: {
transpileOnly: false
}
}))
FAQs
next.js + Inferno
The npm package next-inferno receives a total of 1 weekly downloads. As such, next-inferno popularity was classified as not popular.
We found that next-inferno demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.