diff --git a/config/webpack/webpack.base.js b/config/webpack/webpack.base.js index 77a2732..098c586 100644 --- a/config/webpack/webpack.base.js +++ b/config/webpack/webpack.base.js @@ -1,4 +1,3 @@ -import p from "bundle-declarations-webpack-plugin"; import path from "path"; const __dirname = path.resolve(); @@ -27,17 +26,5 @@ export default { "@": path.resolve(__dirname, "src/") } }, - target: "node", - plugins: [ - new p.BundleDeclarationsWebpackPlugin({ - entry: { - filePath: "./src/utils/types.ts", - libraries: { - inlinedLibraries: ["zod", "@"] - } - }, - outFile: "types.d.ts", - compilationOptions: {} - }) - ] + target: "node" }; diff --git a/config/webpack/webpack.prod.js b/config/webpack/webpack.prod.js index 8c1d9f8..1f26bcc 100644 --- a/config/webpack/webpack.prod.js +++ b/config/webpack/webpack.prod.js @@ -1,4 +1,5 @@ import webpackBaseConfig from "./webpack.base.js"; +import bundle from "bundle-declarations-webpack-plugin"; import { merge } from "webpack-merge"; export default merge(webpackBaseConfig, { @@ -10,5 +11,19 @@ export default merge(webpackBaseConfig, { minimize: true, providedExports: true, usedExports: true - } + }, + plugins: [ + new bundle.BundleDeclarationsWebpackPlugin({ + entry: { + filePath: "./src/utils/types.ts", + libraries: { + inlinedLibraries: ["zod", "@"] + } + }, + outFile: "index.d.ts", + compilationOptions: {}, + removeEmptyLines: false, + removeEmptyExports: false + }) + ] });