Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

413
Vistas
How to run Vue 3/Vite app in library mode for test/demo purposes?

I am trying to create Vue 3 components library as a npm package using Vite.js. I have configured Vite accordingly to the docs. It works, but I need to test my library somehow.

Before I created libraries with vue-sfc-rollup and it has special script and folder for that purpose.

package.json (in vue-sfc-rollup):

"scripts": {
    "serve": "vue-cli-service serve dev/serve.ts"
....

And in that folder:

dev/
    serve.ts
    serve.vue

serve.ts:

import { createApp } from 'vue';
import Dev from './serve.vue';

const app = createApp(Dev);
app.mount('#app');

Which is creates a small SPA for testing/demo.

I am trying to achieve something similar to this with Vite. Any ideas?

UPD:

So, the question probably is how to specify certain main.js file while running Vite?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Take a look at this guide. You will not need vue-sfc-rollup anymore while you are using Vite. Vite uses rollup behind the scence.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda