Disable SSR for specific pages in Next.js, decreasing code loaded in the server
Reduce your Next.js app server code size by disabling SSR for specific pages.
Only works with pages, not app directory
edge
Vercel deploy possible if your current bundle size is more than 2Mb compressednpm i -D elacca
Full application example in the example-app folder.
// next.config.js
const { withElacca } = require('elacca')
/** @type {import('next').NextConfig} */
const config = {}
const elacca = withElacca({})
const nextConfig = elacca(config) // notice the double invocation
module.exports = nextConfig
When using the pages
directory, you can add a directive to disable SSR for a specific page:
// pages/index.js
'skip ssr'
export default function Home() {
return <div>hello world</div>
}
To have an intuitive understanding of how this works, you can check out how this plugin transforms pages in the example-app/elacca-outputs folder.
null
From the Dune wiki:
The Elacca drug is a narcotic that was formed by the burning of Elacca Wood of the planet Ecaz. Its main characteristic when administered was that it would eliminate the user's will for self-preservation