Files
lodestar/packages/light-client/vite.config.ts
Nazar Hussain 51efa3d604 chore: update the test runner (#7404)
**Motivation**

Update vitest and browser engine.

**Description**

- Move root level shared configs to `configs` directory
- Update to vitest 3.x
- Migrate from `webdriverio` to `playwright` which is more stable and
recommended by Vitest.

**NOTE**
Reverted the `playwright` upgrade. See the comments. 


d2a7af0308/configs/vitest.config.base.browser.ts (L41-L43)

**Steps to test or reproduce**

Run all tests
2025-02-27 10:27:43 -05:00

45 lines
1.2 KiB
TypeScript

import path from "node:path";
import fs from "node:fs";
import {defineConfig, mergeConfig} from "vite";
import dts from "vite-plugin-dts";
import {getBaseViteConfig} from "../../configs/vite.config.base.js";
import pkgJSON from "./package.json";
export default mergeConfig(
getBaseViteConfig(pkgJSON, {libName: "LightClient", entry: "src/index.ts"}),
defineConfig({
plugins: [
dts({
rollupTypes: true,
bundledPackages: ["@lodestar/*", "@chainsafe/persistent-merkle-tree", "@chainsafe/bls", "@chainsafe/ssz"],
afterBuild() {
fs.renameSync(
path.join(import.meta.dirname, "dist", "index.d.ts"),
path.join(import.meta.dirname, "dist", "lightclient.min.d.mts")
);
},
}),
],
build: {
rollupOptions: {
output: {
footer: `
globalThis.lodestar = globalThis.lodestar === undefined ? {} : globalThis.lodestar;
globalThis.lodestar.lightclient = {
Lightclient,
LightclientEvent,
RunStatusCode,
upgradeLightClientFinalityUpdate,
upgradeLightClientOptimisticUpdate,
utils,
transport,
validation
};
`,
},
},
},
})
);