Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
esbuild-plugin-d.ts
Advanced tools
esbuild-plugin-d.ts
ESBuild plugin for compiling typescript declarations
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.
const { dtsPlugin } = require("esbuild-plugin-d.ts");
const { build } = require("esbuild");
// OR
import { dtsPlugin } from "esbuild-plugin-d.ts";
import { build } from "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.
The 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.
This plugin has experimental declaration bundling support, to enable it, set experimentalBundling
to true in the plugin's options as follows:
Note that this also requires you to set your entry points in ESBuild.
build({
entryPoints: ["./test/index.ts"],
outdir: "./dist",
plugins: [dtsPlugin({
experimentalBundling: true
})]
})
Once proven to be stable, this will be enabled when bundle
is set to true in ESBuild and will be documented properly.
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 outdirtsconfig: 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
ESBuild plugin for compiling typescript declarations
We found that esbuild-plugin-d.ts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.