mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-09 07:38:03 -05:00
**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
45 lines
1.2 KiB
TypeScript
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
|
|
};
|
|
`,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
);
|