{"id":13515530,"url":"https://github.com/queses/next-inferno","last_synced_at":"2025-03-31T04:37:09.039Z","repository":{"id":65458180,"uuid":"125763618","full_name":"queses/next-inferno","owner":"queses","description":"NextJS plugin for blazing fast Inferno-powered rendering","archived":false,"fork":false,"pushed_at":"2018-03-21T13:51:48.000Z","size":6,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T08:51:10.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/queses.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-18T20:12:59.000Z","updated_at":"2023-07-05T09:18:53.000Z","dependencies_parsed_at":"2023-01-24T13:15:30.075Z","dependency_job_id":null,"html_url":"https://github.com/queses/next-inferno","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queses%2Fnext-inferno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queses%2Fnext-inferno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queses%2Fnext-inferno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queses%2Fnext-inferno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/queses","download_url":"https://codeload.github.com/queses/next-inferno/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418657,"owners_count":20773934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:01:12.543Z","updated_at":"2025-03-31T04:37:08.513Z","avatar_url":"https://github.com/queses.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Next.js + Inferno\n\nUse [Inferno](https://infernojs.org) :fire: with [Next.js](https://github.com/zeit/next.js) to get even faster :zap: rendering.\n\n## Installation\n\n```\nnpm install --save next-inferno inferno inferno-compat inferno-clone-vnode inferno-create-class inferno-create-element\n```\n\nor\n\n```\nyarn add next-inferno inferno inferno-compat inferno-clone-vnode inferno-create-class inferno-create-element\n```\n\n## Usage\n\nCreate a `next.config.js` in your project\n\n```js\n// next.config.js\nconst withInferno = require('next-inferno')\nmodule.exports = withInferno()\n```\n\nThen create a `server.js`\n\n```js\n// server.js\nrequire('next-inferno/alias')()\nconst { createServer } = require('http')\nconst next = require('next')\n\nconst app = next({ dev: process.env.NODE_ENV !== 'production' })\nconst handle = app.getRequestHandler()\nconst port = process.env.PORT || 3000\n\napp.prepare()\n.then(() =\u003e {\n  createServer(handle)\n  .listen(port, () =\u003e {\n    console.log(`\u003e Ready on http://localhost:${port}`)\n  })\n})\n```\n\nThen add or change \"scripts\" section of your `package.json`:\n```json\n...\n\"scripts\": {\n  \"dev\": \"node server.js\",\n  \"build\": \"next build\",\n  \"start\": \"NODE_ENV=production node server.js\"\n},\n...\n```\n\nOptionally you can add your custom Next.js configuration as parameter\n\n```js\n// next.config.js\nconst withInferno = require('next-inferno')\nmodule.exports = withInferno({\n  webpack(config, options) {\n    return config\n  }\n})\n```\n\n## TypeScript support\nLooking for [TypeScript](http://www.typescriptlang.org/) support? Just follow that easy steps to use it in your Next projects:\n\n1. Install `typescript` and `@zeit/next-typescript`:\n\n```\nnpm install --save typescript @zeit/next-typescript\n```\n\nor\n\n```\nyarn add typescript @zeit/next-typescript\n```\n\n2. Edit `next.config.js`:\n\n```js\n// next.config.js\nconst withInferno = require('next-inferno')\nconst withTypescript = require('@zeit/next-typescript')\n\nmodule.exports = withInferno(withTypescript())\n```\n\n3. Create 'tsconfig.json' file:\n\n```json\n{\n  \"compileOnSave\": false,\n  \"compilerOptions\": {\n    \"target\": \"esnext\",\n    \"module\": \"esnext\",\n    \"jsx\": \"preserve\",\n    \"allowSyntheticDefaultImports\": true,\n    \"allowJs\": true,\n    \"moduleResolution\": \"node\",\n    \"sourceMap\": true,\n    \"removeComments\": false,\n    \"baseUrl\": \".\",\n    \"lib\": [\n      \"dom\",\n      \"es2015\",\n      \"es2016\"\n    ]\n  }\n}\n```\n\n4. Write code :fire:\n\n### Check on compile\nBy 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).\n\nIf you want to enable typechecks on compile to see type errors in terminal or browser, make the following changes in 'next.config.js':\n\n```js\n// next.config.js\nconst withInferno = require('next-inferno')\nconst withTypescript = require('@zeit/next-typescript')\n\nmodule.exports = withInferno(withTypescript({\n  webpack(config, options) {\n    return config\n  },\n  typescriptLoaderOptions: {\n    transpileOnly: false\n  }\n}))\n```\n\nAlternatively to decrease compile time you can use [`fork-ts-checker-webpack-plugin`](https://github.com/Realytics/fork-ts-checker-webpack-plugin) to fork type checks in a separate process:\n\n```js\n// next.config.js\nconst withInferno = require(\"next-inferno\")\nconst withTypescript = require(\"@zeit/next-typescript\")\nvar ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');\n\nmodule.exports = withInferno(withTypescript({\n  webpack(config, options) {\n    if (options.isServer) config.plugins.push(new ForkTsCheckerWebpackPlugin())\n    return config\n  }\n}))\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueses%2Fnext-inferno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqueses%2Fnext-inferno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueses%2Fnext-inferno/lists"}