10 lines
1.0 KiB
Markdown
10 lines
1.0 KiB
Markdown
# How this script works
|
||
|
||
1. It creates the project folder, initializes npm, and installs Vue version 3 (instead of vue@next) along with TypeScript, Vite, and the Vue plugin.
|
||
2. It creates a src folder with a sample Vue component (MyComponent.vue) and an entry file (index.ts) that registers and exports the component.
|
||
3. It sets up the TypeScript configuration (tsconfig.json) including declaration file generation.
|
||
4. 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.
|
||
5. 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.
|
||
6. 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. |