Vite : Install2026/06/16 |
|
Install the front-end build tool Vite. |
|
| [1] | |
| [2] | Create a test Vite application with a vue.js template. |
|
ubuntu@dlp:~$ npm create vite@latest testproject -- --template vue Need to install the following packages: create-vite@9.0.7 Ok to proceed? (y) ..... ..... added 35 packages, and audited 36 packages in 7s 9 packages are looking for funding run `npm fund` for details found 0 vulnerabilities Starting dev server...ubuntu@dlp:~$ cd testproject ubuntu@dlp:~/testproject$ npm run dev > testproject@0.0.0 dev > vite VITE v8.0.16 ready in 243 ms → Local: http://localhost:5173/ → Network: use --host to expose → press h + enter to show help # if you like to access to the app from remote hosts, add [--host] option ubuntu@dlp:~/testproject$ vi package.json
{
"name": "testproject",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
// add follows
"dev": "vite --host",
"build": "vite build",
"preview": "vite preview"
},
ubuntu@dlp:~/testproject$
vi vite.config.js
export default defineConfig({
// add follows
server: {
host: true,
},
plugins: [vue()],
})
ubuntu@dlp:~/testproject$ npm run dev > testproject@0.0.0 dev > vite --host VITE v8.0.16 ready in 239 ms → Local: http://localhost:5173/ → Network: http://10.0.0.30:5173/ → press h + enter to show help |
| Access to the URL that is shown on the console above, and then that's OK if following app is shown. |
|
| Sponsored Link |
|
|