Here’s a quick and very handy one:
Say you are running your Nuxt site as normal on localhost:3000, and you want to run it off a tablet or phone or something over the same network.
This will give you your site at your NORMAL IP address (go to cmd and type ipconfig to find out what this is if you don’t already know it) and a port of 8000. So if you grab your phone now, you will see your site at 192.whatever.your.ipnumber:8000
Hope that helps someone!
//Go to package.json
{
"name": "YOURPROJECT",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"dev:host": "nuxt --hostname 0.0.0.0 --port 8000" <<<< add this bad boy, (remember no comma if it's the last item)
},
"dependencies": {
"core-js": "^3.15.1",
"nuxt": "^2.15.7",
"particles.vue": "^2.19.0",
"sass": "^1.41.1",
"sass-loader": "10",
"vue": "2",
"vue-scroll-reveal": "^1.0.11"
},
"devDependencies": {
"@nuxtjs/google-fonts": "^1.3.0"
}
}