initial
This commit is contained in:
commit
74ae93a96e
1 changed files with 94691 additions and 0 deletions
|
|
@ -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
|
||||
```
|
||||
Loading…
Reference in a new issue