dts-webpack-plugin
via npm or yarnplugins
section of your webpack configuration file to include the following:plugins: [
new DtsBundlePlugin({
name: '<library-name>',
main: '<path-to-bundle.js>',
out: '<path-to-output.d.ts>',
removeSource: true,
outputAsModuleFolder: true, // optional
headerText: '', // optional
footerText: '', // optional
}),
// ...
]
<library-name>
with the actual name of your library<path-to-bundle.js>
with the actual path to the minimized bundle file<path-to-output.d.ts>
with the actual path where you want the .d.ts
file to be generatedwebpack
to generate the minimized bundle and the .d.ts
fileAsked: 2023-05-16 08:39:44 +0000
Seen: 8 times
Last updated: May 16 '23