JSPM

ts-declaration-webpack-plugin

1.2.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 48
  • Score
    100M100P100Q62755F
  • License MIT

Bundler for your ts / tsx files that actually works

Package Exports

  • ts-declaration-webpack-plugin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ts-declaration-webpack-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ts-declaration-webpack-plugin

This Webpack plugin generate a single TypeScript *.d.ts declaration file per entry.

Installation

$ npm install ts-declaration-webpack-plugin --save-dev

Usage

  • Simply add the plugin to webpack.config.js:

    const TsDeclarationWebpackPlugin = require('ts-declaration-webpack-plugin');
    
    module.exports = {
        entry: {
            app: './src/main.ts',
            component: './src/component.tsx',
        },
        output: {
            path: path.resolve('./dist'),
            filename: '[name].js',
        },
        plugins: [
            new TsDeclarationWebpackPlugin(),
        ]
    }
  • Done! will generate app.d.ts and component.d.ts next to the js files in dist folder!

Options

new TsDeclarationWebpackPlugin({
    name: '[name].d.ts', // Not required, '[name].d.ts' by default (to match output fileName)
    test: /\.tsx$/, // Not required, filters '.ts' and '.tsx' by default
})

Have Fun!