Gathering detailed insights and metrics for bundle-declarations-webpack-plugin
Gathering detailed insights and metrics for bundle-declarations-webpack-plugin
Gathering detailed insights and metrics for bundle-declarations-webpack-plugin
Gathering detailed insights and metrics for bundle-declarations-webpack-plugin
dts-bundle-webpack-plugin
Webpack plugin for bundling Typescript declarations
react-style-webpack-plugin
Webpack plugin to extract React Style style declarations into CSS bundle
@dvmm/bundle-ts-dec-webpack-plugin
Bundle type declarations into a single file.
hicet
Enables bundled Webpack Typescript declarations from exports.
npm install bundle-declarations-webpack-plugin
Typescript
Module System
Min. Node Version
Node Version
NPM Version
v6.0.0
Updated on Dec 18, 2024
v5.1.1
Updated on Mar 04, 2024
5.0.1 - Update dts-bundle-generator dependency
Updated on Jan 27, 2024
5.0.0 - Wrap 9.0.0 dts-bundle-generator
Updated on Dec 20, 2023
v4.0.2 - Updated dependencies
Updated on Dec 20, 2023
4.0.1
Updated on Dec 23, 2022
TypeScript (92.05%)
JavaScript (7.95%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
8 Stars
59 Commits
2 Forks
6 Branches
3 Contributors
Updated on Dec 18, 2024
Latest Version
6.0.0
Package Id
bundle-declarations-webpack-plugin@6.0.0
Unpacked Size
14.94 kB
Size
5.88 kB
File Count
6
NPM Version
10.9.2
Node Version
23.4.0
Published on
Dec 18, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
1
As of version 3.1.0, it's possible to omit the configuration overrides; when you do this, the plugin will fallback on webpack
's entrypoints and other defaults.
1import BundleDeclarationsWebpackPlugin from "bundle-declarations-webpack-plugin"; 2import { resolve } from "path"; 3import type { Configuration } from "webpack"; 4 5export default <Configuration> { 6 entry: "./src/main.ts", 7 output: { 8 filename: "index.js", 9 path: resolve("./dist"), 10 }, 11 plugins: [ 12 `...`, 13 new BundleDeclarationsWebpackPlugin(), 14 ], 15};
The configuration above adds the plugin with default options. All typescript included/imported by the ./src/main.ts
file is transpiled to ./dist/index.js
and all exported types for the bundle are added to the output directory with the default name index.d.ts
.
Just to be clear, currently the output filename is defaulted to this value, but the key in webpack
's entry is not considered/applied if set as it is with the webpack bundle.
Usually you will want to include all types which are visible on the surface of a library, but the entry
and outFile
may not necessarily match with your webpack bundle.
1import BundleDeclarationsWebpackPlugin from "bundle-declarations-webpack-plugin"; 2import type { Configuration } from "webpack"; 3 4export default <Configuration> { 5 plugins: [ 6 `...`, 7 new BundleDeclarationsWebpackPlugin({ 8 entry: ["./src/index.ts", "./src/globals.ts"], 9 outFile: "main.d.ts", 10 }), 11 ] 12}
In the above example, the exports of index.ts
and globals.ts
are combined into webpack's output as main.d.ts
.
dts-bundle-generator
1import BundleDeclarationsWebpackPlugin from "bundle-declarations-webpack-plugin"; 2import type { Configuration } from "webpack"; 3 4export default <Configuration> { 5 plugins: [ 6 `...`, 7 new BundleDeclarationsWebpackPlugin({ 8 entry: { 9 filePath: "./src/index.ts", 10 libraries: { 11 inlinedLibraries: [ 12 "tsyringe", 13 ], 14 }, 15 output: { 16 sortNodes: false, 17 // dts-bundle-generator comments in output 18 noBanner: false, 19 } 20 }, 21 outFile: "index.d.ts", 22 23 compilationOptions: { 24 followSymlinks: true, 25 preferredConfigPath: "./some/tsconfig.json", 26 }, 27 28 // setting these will mean no post-processing 29 removeEmptyLines: false, 30 removeEmptyExports: false, 31 removeRelativeReExport: false, 32 }), 33 ] 34}
Assuming you want to combine into 1 .d.ts bundle, this can be achieved by providing an array of EntryPointConfig
s to a single plugin instance's entry
option.
This is expected, it should be completely safe to use multiple instances of the plugin as part of webpack
's parallel builds; in fact the only thing stopping you from reusing the same instance is that the options are shared (which might be fine in some cases).
As of version 4.0.0, .d.ts bundling runs as a background process while webpack
is in watch mode; this means that it will no longer delay incremental builds, but consequently the declarations may become out of sync with the webpack compilations.
Also note that the plugin will output to the file system even when shouldEmit
returns false
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
Found 1/24 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More