This plugin offers a zero-configuration solution for bundling TypeScript libraries within Vue CLI projects. It's specifically designed to facilitate the creation of single JavaScript component files along with their corresponding TypeScript declaration files (`.d.ts`). Currently at version 0.0.3, the project appears to be abandoned, with no significant updates in several years. Its core functionality wraps `dts-bundle`, automatically configuring `webpack` to resolve conflicts that typically arise during `.d.ts` file generation with tools like `thread-loader` and `cache-loader`. This allows developers to publish Vue components as external modules, maintaining full TypeScript support without extensive build configuration, differentiating it from manual `webpack` setup or alternative bundlers.
npm install vue-cli-plugin-ts-bundlerVerified import paths — ran on the pinned version, not inferred.
This quickstart guides you through creating a new Vue TypeScript library project using a preset, building it, and then bundling its TypeScript declaration files into a single `.d.ts` output.
No user action is required; the plugin automatically handles this conflict. Do not re-enable `thread-loader` for TypeScript compilation if using this plugin.
No user action is required; the plugin automatically handles this conflict. Avoid manual `cache-loader` configurations that might conflict.
For new projects, consider using more actively maintained build tools like Vite, Rollup, or alternative Vue CLI plugins for TypeScript library bundling. If encountering issues, migrating away is recommended.
Ensure `vue-cli-plugin-ts-bundler` is correctly installed via `vue add ts-bundler`. Avoid manual webpack configurations that override the plugin's loader disabling. Verify `tsconfig.json` correctly specifies `declaration: true`.
Run `vue add ts-bundler` in your project root to ensure proper installation and configuration. If already installed, try `npm install` to refresh `node_modules` or specify `npx` explicitly: `npx vue-cli-service bundle-dts`.
Verify that your `package.json` contains a script like `"bundleDts": "vue-cli-service bundle-dts"`. If the script exists, try running `npx vue-cli-service bundle-dts` directly to see the raw error message from the bundler.