,

Experimenté con el Killer de Vite.js

Posted by


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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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!

0 0 votes
Article Rating
40 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@d-landjs
3 months ago

Pero no veo que aún nadie lo usa o si? jajaja siempre habrán nuevos killers

@antoniomadrid7870
3 months ago

Impresionante los nuevos empaquetadores, lo mismo te meten un backdoor en 0.125 ms 🤪

@estebancordoba555
3 months ago

Como que Nest? se puede empaquetar Nest O cual seria su utilidad en backend

@brunoguerra2055
3 months ago

y que paso con turbo pack

@AaronCamposMiranda
3 months ago

Alguien sabe cómo instalarle tailwind a esto? Y si es posible usarlo con JS en lugar de TS

@salvadorpucheibanez2213
3 months ago

Yo sigo usando webpack y vite

@danielmt8214
3 months ago

0:03 editor en su prime

@carlogustavovalenzuelazepe5774
3 months ago

Me encanta como rust entro de lleno al negocio

@CristalNuke
3 months ago

estoy trabajando un proyecto con vite, miro este video mostrando los graficos y siento que estoy usando a la tortuga manuelita :S

@jesusfranciscogarciaesparz2541
3 months ago

Vite también pronto saldrá con rust, no? O estoy equivocado?

@deadbryam
3 months ago

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

@codelaby
3 months ago

Para hallar la respuesta de donde ha salido, es si son devs chinos, es la única explicación que me viene en cabeza

@paohdz10
3 months ago

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.

@fdorantesm
3 months ago

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.

@code_castle
3 months ago

makojs lo usab antd ufff por favor saca un video usando antd te encantara

@floresflores5831
3 months ago

Todos menos Angular, porque será.

@mddx56
3 months ago

Rauch lo compartio en twitter

@bhaskara0g468
3 months ago

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

@herberthobregon5474
3 months ago

trump: China, china, Asia, China, China, china, Asia, China

@enriquemosso9727
3 months ago

Ay cabron! jajjaja