rollup-plugin-svelte-types

1.0.6 • Public • Published

rollup-plugin-svelte-types

🍣 A Rollup plugin which generates type definitions for Svelte Components, including Props and Events.

Requirements

This plugin requires an LTS Node version (v8.0.0+) and Rollup v1.20.0+.

Install

Using npm:

npm install rollup-plugin-svelte-types --save-dev

Usage

Create a rollup.config.js configuration file and import the plugin:

import svelteDts from 'rollup-plugin-svelte-types';

export default {
  input: 'src/entry.js',
  // ...
  plugins: [
    svelteDts()
  ]
};

Then call rollup either via the CLI or the API.

Options

It's possible to use configure a few settings:

import svelteDts from 'rollup-plugin-svelte-types';

export default {
  input: 'src/entry.js',
  // ...
  plugins: [
    svelteDts({
        libRoot: './src', // The root directory to generate the type definitions for. Defaults to './'
        declarationDir: './dist/types' // The directory to place the generated definitions in. Defaults to './types'
    })
  ]
};

License

MIT

Package Sidebar

Install

npm i rollup-plugin-svelte-types

Weekly Downloads

8

Version

1.0.6

License

MIT

Unpacked Size

3.93 kB

Total Files

4

Last publish

Collaborators

  • fallaciousreasoning