Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
rsbuild-plugin-dts
Advanced tools
Rsbuild plugin that supports emitting declaration files for TypeScript.
An Rsbuild plugin to emit declaration files for TypeScript which is built-in in Rslib.
Read DTS and lib.dts for more details.
Install:
npm add rsbuild-plugin-dts -D
Add plugin to rsbuild.config.ts
:
// rsbuild.config.ts
import { pluginDts } from 'rsbuild-plugin-dts';
export default {
plugins: [pluginDts()],
};
boolean
false
Whether to bundle the DTS files.
If you want to bundle DTS files, you should:
@microsoft/api-extractor
as a development dependency, which is the underlying tool used for bundling DTS files.npm add @microsoft/api-extractor -D
bundle
to true
.pluginDts({
bundle: true,
});
string
The output directory of DTS files. The default value follows the priority below:
distPath
value of the plugin options.declarationDir
value in the tsconfig.json
file.pluginDts({
distPath: './dist-types',
});
boolean
false
Whether to generate DTS files with building the project references. This is equivalent to using the --build
flag with the tsc
command. See Project References for more details.
When this option is enabled, you must explicitly set declarationDir
or outDir
in tsconfig.json
in order to meet the build requirements.
boolean
true
Whether to abort the build process when an error occurs during DTS generation.
By default, type errors will cause the build to fail.
When abortOnError
is set to false
, the build will still succeed even if there are type issues in the code.
pluginDts({
abortOnError: false,
});
string
'.d.ts'
The extension of the DTS file.
pluginDts({
dtsExtension: '.d.mts',
});
boolean
true
Whether to automatically externalize dependencies of different dependency types and do not bundle them into the DTS file.
The default value of autoExternal
is true
, which means the following dependency types will not be bundled:
dependencies
optionalDependencies
peerDependencies
And the following dependency types will be bundled:
devDependencies
pluginDts({
autoExternal: {
dependencies: true,
optionalDependencies: true,
peerDependencies: true,
devDependencies: false,
},
});
string
undefined
Inject content into the top of each DTS file.
pluginDts({
banner: '/** @banner */',
});
string
undefined
Inject content into the bottom of each DTS file.
pluginDts({
footer: '/** @footer */',
});
Please read the Contributing Guide.
FAQs
Rsbuild plugin that supports emitting declaration files for TypeScript.
The npm package rsbuild-plugin-dts receives a total of 5,110 weekly downloads. As such, rsbuild-plugin-dts popularity was classified as popular.
We found that rsbuild-plugin-dts 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.