2.0.5 • Published 7 months ago

vite-plugin-dts-bundle-generator v2.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

DTS Bundle Generator Vite plugin

npm npm npm

Ever wanted to easily package your typescript library with a bundled declaration file? Integrate DTS Bundle Generator within Vite!

Install

# npm
npm i vite-plugin-dts-bundle-generator

# yarn
yarn add vite-plugin-dts-bundle-generator

Usage

Add this block to your vite.config.ts:

import path from 'path';
import { defineConfig, normalizePath } from 'vite';
import dtsBundleGenerator from 'vite-plugin-dts-bundle-generator';

export default defineConfig({
  plugins: [
    dtsBundleGenerator({
      fileName: 'my-lib.d.ts',
      output: {
        // output config
      },
      libraries: {
        // libraries config
      }
    }, {
      // compilation options
    })
  ],
  build: {
    lib: {
      entry: normalizePath(path.resolve('src', 'index.ts')),
      formats: ['es'],
      fileName: 'my-lib.mjs'
    }
  }
});

And that's it!

Configuration

This library handle both single and multiple entrypoints. You can use any of the output, libraries and compilation options available in the config file of DTS Bundle Generator.

2.0.5

7 months ago

2.0.3

1 year ago

2.0.4

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.0

1 year ago

1.0.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago