Currently, I am in the process of developing a Vue 3 components library and transforming it into an npm package using Vite.js. Following the guidelines provided in the official documentation, I have successfully configured Vite. However, I am faced with the need to conduct testing on my library.
In previous instances, when creating libraries, I utilized vue-sfc-rollup, which included specialized scripts and folders designated for this purpose.
The structure within 'package.json' (using vue-sfc-rollup) looked like:
"scripts": {
"serve": "vue-cli-service serve dev/serve.ts"
....
Within that particular folder:
dev/
serve.ts
serve.vue
Contents of 'serve.ts':
import { createApp } from 'vue';
import Dev from './serve.vue';
const app = createApp(Dev);
app.mount('#app');
This setup enabled the creation of a small Single Page Application (SPA) for demonstration and testing purposes.
I am now attempting to replicate this functionality with Vite. Any suggestions or thoughts on how to proceed?
Update:
My current dilemma is figuring out how to specify a specific 'main.js' file while running Vite. Any insights would be greatly appreciated.