Build dts files with webpack
After Webpack is built, it is no longer the original resource.
Therefore, if you want to export .d.ts
files, you need to execute tsc
to compile the .d.ts
file.
- It can directly output
d.ts
files. - Support alias of
tsconfig.json
by default.- It was use ts-patch to support alias.
# use npm
$ npm install --dev @dumlj/dts-webpack-plugin
# use yarn
$ yarn add --dev @dumlj/dts-webpack-plugin
# use pnpm
$ pnpm add @dumlj/dts-webpack-plugin -D
import { OneWebpackDTSPlugin } from '@series-one/webpack-dts-plugin'
export default {
plugins: [
new OneWebpackDTSPlugin({
rootDir: path.join(__dirname, './src'),
}),
],
}
After execution, please check the console
or ./build
directory.
@dumlj/dts-webpack-plugin ├─┬ @dumlj/seed-webpack-plugin │ ├─┬─ @dumlj/feature-updater │ │ ├─── @dumlj/shell-lib │ │ ├─── @dumlj/util-lib │ │ └─── @dumlj/mock-libPRIVATE │ └─── @dumlj/mock-libPRIVATE └── @dumlj/shell-lib