Vite.js is a build tool that aims to provide a faster and more efficient development experience for frontend developers. One of the key features of Vite is its ability to use native ES module imports in your projects, resulting in much faster build times compared to traditional bundlers like Webpack or Rollup.
In this tutorial, we will be exploring the "Killer" feature of Vite.js, which allows you to create a production-ready build of your project with just one command.
- Installation
First, you need to install Vite.js globally on your system. You can do this by running the following command:
npm install -g create-vite
This will install the create-vite package globally, which allows you to create new Vite projects with ease.
- Creating a new Vite project
To create a new Vite project, run the following command:
create-vite my-vite-project
Replace "my-vite-project" with the name of your project. This will create a new directory with the same name in the current directory, containing a basic Vite setup.
- Setting up the project
Once the project has been created, navigate into the project directory and install the necessary dependencies by running:
cd my-vite-project
npm install
This will install all the required packages for your project to run.
- Running the project in development mode
To start your project in development mode, run the following command:
npm run dev
This will start a development server at http://localhost:3000, where you can view your project live and make changes in real-time.
- Building the project for production
Once you are satisfied with your project and ready to create a production build, you can run the following command:
npm run build
This will create a production-ready build of your project in the "dist" directory. You can then deploy this build to a server or hosting provider to make your project live.
- Optimizing the production build with "Killer"
The real magic of Vite.js comes with its "Killer" feature, which optimizes your production build even further. To use the "Killer" feature, run the following command:
npm run prod
This will run the production build with additional optimizations enabled, resulting in an even faster and smaller build size for your project.
And that’s it! With Vite.js and its "Killer" feature, you can create fast and efficient frontend projects with ease. Happy coding!
Pero no veo que aún nadie lo usa o si? jajaja siempre habrán nuevos killers
Impresionante los nuevos empaquetadores, lo mismo te meten un backdoor en 0.125 ms 🤪
Como que Nest? se puede empaquetar Nest O cual seria su utilidad en backend
y que paso con turbo pack
Alguien sabe cómo instalarle tailwind a esto? Y si es posible usarlo con JS en lugar de TS
Yo sigo usando webpack y vite
0:03 editor en su prime
Me encanta como rust entro de lleno al negocio
estoy trabajando un proyecto con vite, miro este video mostrando los graficos y siento que estoy usando a la tortuga manuelita :S
Vite también pronto saldrá con rust, no? O estoy equivocado?
hacie varios dias migre mi portfolio de vite a Farm pero farm es muy verde hay muchas cosas que me toco rehacer e inclusive cambiar de framework, pero pinta bien
Para hallar la respuesta de donde ha salido, es si son devs chinos, es la única explicación que me viene en cabeza
Eso solo puede significar una cosa, que traen ahi truco, cuidado que pasara lo mismo que con lo de polyfill, es China, no se puede confiar, y es enserio.
En nest da error con el template inicial. Nest es un caso aparte porque no tiene soporte al 100% más que con webpack, swc todavía tiene algunos errores.
makojs lo usab antd ufff por favor saca un video usando antd te encantara
Todos menos Angular, porque será.
Rauch lo compartio en twitter
Todo se esta volviendo tan rápido qye vamos a llegar al momento en que se va a hacer el build antes de que termines el proyecto
trump: China, china, Asia, China, China, china, Asia, China
Ay cabron! jajjaja