Skip to content

mtraynham/dts-generator-webpack-plugin

Repository files navigation

npm version Build Status

dts-generator-webpack-plugin

A plugin that executes dts-generator and appends the results to the webpack compilation as an additional asset.

Usage

import DtsGeneratorPlugin, {IDtsGeneratorPluginOptions} from 'dts-generator-webpack-plugin';
import resolve from 'path';
import {Configuration} from 'webpack';

const dtsGeneratorPluginOptions: IDtsGeneratorPluginOptions = {
    name: 'myPackage'
};
const webpackConfig: Configuration = {
    entry: 'index.ts',
    output: {
        path: resolve(__dirname, 'dist'),
    },
    plugins: [
        new DtsGeneratorPlugin(dtsGeneratorPluginOptions)
    ]
};
export default webpackConfig;

Options

All options provided by dts-generator are supported. The option out is no longer required and will be ignored if set as this plugin instead appends it as an additional asset to the webpack build. The Webpack configuration's output will instead decide where the generated d.ts file is placed.

About

A webpack plugin for dts-generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published