Socket
Socket
Sign inDemoInstall

esbuild-plugin-d.ts

Package Overview
Dependencies
8
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    esbuild-plugin-d.ts

ESBuild plugin for compiling typescript declarations


Version published
Weekly downloads
7.2K
decreased by-10.36%
Maintainers
1
Install size
190 kB
Created
Weekly downloads
 

Readme

Source

esbuild-plugin-d.ts

ESBuild plugin for compiling typescript declarations

WARNING

This plugin was made to make it easier to build declarations without running two commands simultaneously. It will add a lot of overhead to your build time and should only really be used as a last resort.

Alternatives

  • TSUP - Similar usage to this plugin, but more stable and configurable. A CLI tool wrapped around ESBuild rather than a plugin
  • Estrella

Usage

const { dtsPlugin } = require("esbuild-plugin-d.ts");
const { build } = require("esbuild");

build({
    entryPoints: ["./test/index.ts"],
    outdir: "./dist",
    plugins: [dtsPlugin({
        // Optional options here
    })]
})

The plugin uses the typescript compiler api. You don't need to enable declarations in your tsconfig.

  • Plugin does not enable incremental mode unless incremental is set to true in your tsconfig. When this is enabled, the plugin will automatically assume a tsbuildinfo file but will respect your config if set there.
    • Be aware that if you delete your dist folder and have incremental mode enabled, your declarations may not be built.

Options

  • outDir: string (DEPRECATED) - override the output directory - you should define declarationDir in your tsconfig instead. The plugin will also fall back to your tsconfig outDir or esbuild outdir
  • tsconfig: string | object - A path to your tsconfig or a tsconfig object. The plugin will automatically find your tsconfig if you don't specify one.

All other functionality is derived from your tsconfig

See tests here here

FAQs

Last updated on 19 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc