Zero configuration bundler for your TypeScript library
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
 
If yon don't have a project, you can create it using the preset:
vue create --preset vatson/vue-ts-lib my-vue-libMore information you can find here https://github.com/vatson/vue-ts-lib
Install the plugin into your project:
cd my-vue-app
vue add ts-bundlerNow you can run build or use CLI commands listed below.
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 bundleDtsAll supported options you can find here https://github.com/TypeStrong/dts-bundle
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
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 tots-loader
- https://github.com/vatson/vue-cli-plugin-ts-paths helps to avoid duplication of configurations for your path aliases
 
- Add an ability to replace default HelloWorld with a base component;
 
MIT