Files
vue-plugin-setup/readme.md
2025-02-23 00:00:39 -07:00

1.0 KiB
Raw Blame History

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, youll 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.