Reputation: 1064
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?
Upvotes: 0
Views: 3519