Skip to content

Commit

Permalink
🐛 Fix(webpack): fix build output of d.ts files
Browse files Browse the repository at this point in the history
  • Loading branch information
INeedJobToStartWork committed Jan 9, 2024
1 parent 10d213b commit 86ada6d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
15 changes: 1 addition & 14 deletions config/webpack/webpack.base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import p from "bundle-declarations-webpack-plugin";
import path from "path";

const __dirname = path.resolve();
Expand Down Expand Up @@ -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"
};
17 changes: 16 additions & 1 deletion config/webpack/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -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, {
Expand All @@ -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
})
]
});

0 comments on commit 86ada6d

Please sign in to comment.