Commit a5439d5a authored by Sébastien Chopin's avatar Sébastien Chopin

chore: simplify and upgrade to rc11

parent 98017c87
shamefully-hoist=true shamefully-hoist=true
auto-install-peers=true
...@@ -3,22 +3,20 @@ ...@@ -3,22 +3,20 @@
Hacker News clone built with [Nuxt3](https://v3.nuxtjs.org). Hacker News clone built with [Nuxt3](https://v3.nuxtjs.org).
<p align="center"> <p align="center">
<a href="https://hn.nuxtjs.org" target="_blank"> <a href="https://hn.nuxt.space" target="_blank">
<img width="1090" src="https://user-images.githubusercontent.com/904724/58875721-97382400-86cc-11e9-94c6-af21544817bb.png"> <img width="1090" src="https://user-images.githubusercontent.com/904724/58875721-97382400-86cc-11e9-94c6-af21544817bb.png">
<br> <br>
Live Demo Live Demo
</a> </a>
</p> </p>
## Deploy ## Demo
- Universal: https://hn.nuxtjs.org https://hn.nuxt.space
> Hosted on [Vercel](https://vercel.com/): `npm run build` > Hosted on [Vercel](https://vercel.com/): `npm run build`
- Single Page: https://hn-spa.nuxtjs.org To disable server-side render for a page, simply append `?csr` to the URL, example: https://hn.nuxt.space/news/1?csr
> Hosted on [Netlify](https://www.netlify.com): `npm run build-spa`
## Performance ## Performance
...@@ -45,21 +43,12 @@ npm install # or yarn ...@@ -45,21 +43,12 @@ npm install # or yarn
# serve in dev mode, with hot reload at localhost:3000 # serve in dev mode, with hot reload at localhost:3000
npm run dev npm run dev
# build for production (universal) # build for production (server-side rendering)
npm run build npm run build
# serve in production mode (universal) # serve in production mode (server-side rendering)
npm start npm start
# build for production (spa)
npm run build-spa
# serve in production mode (spa)
npm run start-spa # or upload .output/public/ directory
# validate code with ESLint (with Prettier)
npm run lint
# validate and fix with ESLint (with Prettier) # validate and fix with ESLint (with Prettier)
npm run lintfix npm run lintfix
``` ```
...@@ -72,6 +61,6 @@ For the Nuxt 2 version, check out the [`nuxt2` branch](https://github.com/nuxt/h ...@@ -72,6 +61,6 @@ For the Nuxt 2 version, check out the [`nuxt2` branch](https://github.com/nuxt/h
MIT MIT
## Credits ## Credits
This repository is originally ported from [vue-hackernews-2.0](https://github.com/vuejs/vue-hackernews-2.0) This repository is originally ported from [vue-hackernews-2.0](https://github.com/vuejs/vue-hackernews-2.0)
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({ export default defineNuxtConfig({
manifest: {
name: 'Nuxt Hacker News',
short_name: 'Nuxt HN',
description: 'HackerNews clone built with Nuxt3',
theme_color: '#2F495E',
start_url: '/news'
},
modules: [
'@nuxtjs/pwa'
],
postcss: { postcss: {
plugins: { plugins: {
'postcss-nested': {} 'postcss-nested': {}
} }
}, },
experimental: { experimental: {
reactivityTransform: true, reactivityTransform: true
viteNode: true
} }
}) })
...@@ -22,20 +22,16 @@ ...@@ -22,20 +22,16 @@
"dev": "nuxi dev", "dev": "nuxi dev",
"build": "nuxi build", "build": "nuxi build",
"start": "nuxi start", "start": "nuxi start",
"dev-spa": "nuxi dev --spa",
"build-spa": "nuxi build --spa",
"start-spa": "nuxi start --spa",
"lint": "eslint --ext .vue,.js,.ts --ignore-path .gitignore ." "lint": "eslint --ext .vue,.js,.ts --ignore-path .gitignore ."
}, },
"engines": { "engines": {
"node": ">=v14.20.0" "node": ">=v14.20.0"
}, },
"devDependencies": { "devDependencies": {
"@nuxtjs/eslint-config-typescript": "^10.0.0", "@nuxtjs/eslint-config-typescript": "^11.0.0",
"@nuxtjs/pwa": "3.3.5", "eslint": "^8.24.0",
"eslint": "^8.22.0", "nuxt": "^3.0.0-rc.11",
"nuxt": "^3.0.0-rc.8",
"postcss-nested": "^5.0.6", "postcss-nested": "^5.0.6",
"typescript": "^4.7.4" "typescript": "^4.8.4"
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
export default defineEventHandler((event) => {
const query = getQuery(event)
if (typeof query.csr !== 'undefined') {
event.req.headers['x-nuxt-no-ssr'] = 'true'
}
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment