How this script works
- It creates the project folder, initializes npm, and installs Vue version 3 (instead of vue@next) along with TypeScript, Vite, and the Vue plugin.
- It creates a src folder with a sample Vue component (MyComponent.vue) and an entry file (index.ts) that registers and exports the component.
- It sets up the TypeScript configuration (tsconfig.json) including declaration file generation.
- It creates a Vite configuration file (vite.config.ts) set up for building a library (producing both ES and UMD formats) with Vue declared as external.
- It uses a small Node.js script (update-package.js) to modify the package.json file—adding build scripts and specifying main, module, and typings—thus avoiding dependencies on the jq command.
- It creates a basic README for usage instructions.
After running this script, you’ll have a project ready for you to add your component(s). You can run "npm run build" to generate distributable files into the dist folder and then publish your package as desired.
Description
Languages
Shell
100%