npm init -y
That creates package.json, the file that describes your project and everything it needs.
{
"name": "merik-site",
"version": "1.0.0",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"dependencies": { "axios": "^1.6.0" },
"devDependencies": { "vite": "^5.0.0" }
}Put a build tool in dependencies and your production install becomes needlessly large. npm install --omit=dev on a server installs only what actually runs.
npm run build
A script can call any binary in node_modules/.bin without a global install. This is why a project can be cloned and built by anyone with the same commands, on any machine.
Always. It is how another person (or a deployment) reconstructs the project.