Zero configuration bundler for your TypeScript library

Downloads in past


0.0.36 years ago6 years agoMinified + gzip package size for vue-cli-plugin-ts-bundler in KB


:rocket: vue-cli-plugin-ts-bundler
Zero configuration bundler for your TypeScript library

Use case

You create a library component that is compiled in a signle js file, and you want to left the support of TypeScript.
The plugin allows to generate a single dts file to share your code as external module.


The plugin is basically a wrapper of dts-bundle. All dts-bundle features are available when using the command.
And additionally:
  • generate the minimum configuration to build TypeScript library
  • removes all conflicts with dts generating

Getting Started

A new project

If yon don't have a project, you can create it using the preset:
vue create --preset vatson/vue-ts-lib my-vue-lib

More information you can find here

Adding to an existing project

Install the plugin into your project:
cd my-vue-app
vue add ts-bundler

Now you can run build or use CLI commands listed below.

CLI Commands

The plugin adds one command bundle-dts to bundle the declaration files generated during build process.
npx vue-cli-service bundle-dts [options]

or already configured npm command
npm run bundleDts

All supported options you can find here

Example of use

Feel free to create an issue if you want to add your project to the list and help others solve their problems on good examples

Known caveats

In order for everything to work correctly, there was a need to disable some webpack's loaders:
  • thread-loader - doesn't allow to write dts files on filesystem;
  • cache-loader - incorrectly caches compilerOptions passed to ts-loader

Potentially useful


  • Add an ability to replace default HelloWorld with a base component;