This commit is contained in:
nm1 2026-11-04 00:33:23 +05:30
commit 74ae93a96e

View file

@ -0,0 +1,41 @@
- nextjs alternative : remix
Initialization
https://yewtu.be/watch?v=__mSgDEOyv8
- Use this to setup nextjs
`npx create-next-app@latest myapp`
Then `npm run dev` to run it
- To run a production build
`npm run build` then
`npm run start`
- Running on different port
In `package.json`
```json
"scripts": {
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start -p 3001",
"lint": "next lint"
},
```
- running it as serverless mode, generate SSG
in next.config.js, do following for static export
```js
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
output: 'export',
// Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html`
// trailingSlash: true,
// Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href`
// skipTrailingSlashRedirect: true,
// Optional: Change the output directory `out` -> `dist`
// distDir: 'dist',
}
module.exports = nextConfig
```