Skip to content

Commit

Permalink
fix: build error log during esm bundle build (#6737)
Browse files Browse the repository at this point in the history
Fix build error
  • Loading branch information
nazarhussain authored May 6, 2024
1 parent 8c55820 commit df6f52e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/light-client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
import fs from "node:fs/promises";
import fs from "node:fs";
import {defineConfig, mergeConfig} from "vite";
import dts from "vite-plugin-dts";
import {getBaseViteConfig} from "../../vite.base.config.js";
Expand All @@ -13,8 +13,8 @@ export default mergeConfig(
dts({
rollupTypes: true,
bundledPackages: ["@lodestar/*", "@chainsafe/persistent-merkle-tree", "@chainsafe/bls", "@chainsafe/ssz"],
async afterBuild() {
await fs.rename(
afterBuild() {
fs.renameSync(
path.join(import.meta.dirname, "dist", "index.d.ts"),
path.join(import.meta.dirname, "dist", "lightclient.min.d.mts")
);
Expand Down
2 changes: 1 addition & 1 deletion vite.base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function getBaseViteConfig(
globals: {Buffer: true, process: true},
protocolImports: true,
}),
...(process.env.CI ? [] : [visualizer()]),
...(process.env.DEBUG_BUNDLE ? [visualizer()] : []),
],
mode: "production",
appType: "custom",
Expand Down

0 comments on commit df6f52e

Please sign in to comment.