Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vuejs3, Vite - How to run Production Build

Tags:

npm

vuejs3

vite

I'm trying to run a simple vue.js app. My setup is a vue.js 3 app with vite, built according to the tutorial on the official website. (https://vitejs.dev/guide/#command-line-interface) Now I try to deploy that on a cloud and I need the command to run the app. I don't find any information about that. My package.json is lacking the entry for start or run. I don't find any information about the command on the official website. What am I missing?

package.json

{
  "name": "my-vite-app",
  "version": "0.0.0",
  "scripts": {
    "dev": "vite",
    "build": "vite build"
  },
  "dependencies": {
    "vue": "^3.0.4"
  },
  "devDependencies": {
    "@vue/compiler-sfc": "^3.0.4",
    "autoprefixer": "^10.3.5",
    "postcss": "^8.3.7",
    "tailwindcss": "^2.2.15",
    "vite": "^1.0.0-rc.13"
  }
}
like image 765
user3603819 Avatar asked Sep 02 '25 04:09

user3603819


1 Answers

You can do it with preview. documentation

"scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },

then

$ npm run build
$ npm run preview
like image 115
alejandrodotor8 Avatar answered Sep 04 '25 23:09

alejandrodotor8