mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-10 08:08:16 -05:00
* Add webpack and cypress dependencies * Add browser tests support for lightclient * Add sinon-chai dependency * Add browser tests to types package * Add browser tests for other packgaes * Add firefox lanucher for karma * Add workflow item to run the browser tests * Fix lint error * Update karma config to avoid DISPLAY error on github actions * Add display flags to run electron * Update sync test to only run in the node * Remove unused dependency * Update default timeout and one typo * Init bls on functions when lightclient is initialized * Remove the sandbox check * Update the test name
67 lines
1.6 KiB
JavaScript
67 lines
1.6 KiB
JavaScript
const webpack = require("webpack");
|
|
const ResolveTypeScriptPlugin = require("resolve-typescript-plugin");
|
|
|
|
module.exports = {
|
|
mode: "production",
|
|
target: "web",
|
|
experiments: {
|
|
topLevelAwait: true,
|
|
},
|
|
optimization: {
|
|
minimize: false,
|
|
},
|
|
stats: {
|
|
errors: true,
|
|
errorDetails: true,
|
|
},
|
|
plugins: [
|
|
new webpack.ProvidePlugin({
|
|
process: "process/browser.js",
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
Buffer: ["buffer", "Buffer"],
|
|
}),
|
|
],
|
|
module: {
|
|
exprContextCritical: false,
|
|
rules: [
|
|
{
|
|
test: /\.ts?$/,
|
|
use: [
|
|
{
|
|
loader: "ts-loader",
|
|
options: {
|
|
configFile: "tsconfig.e2e.json",
|
|
experimentalFileCaching: true,
|
|
transpileOnly: true,
|
|
projectReferences: true,
|
|
},
|
|
},
|
|
],
|
|
exclude: [/node_modules/],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
plugins: [new ResolveTypeScriptPlugin({includeNodeModules: false})],
|
|
fallback: {
|
|
path: require.resolve("path-browserify"),
|
|
"node:path": require.resolve("path-browserify"),
|
|
http: require.resolve("stream-http"),
|
|
https: require.resolve("https-browserify"),
|
|
stream: require.resolve("stream-browserify"),
|
|
"node:stream": require.resolve("stream-browserify"),
|
|
"@chainsafe/blst": false,
|
|
process: false,
|
|
fs: false,
|
|
os: false,
|
|
zlib: false,
|
|
crypto: false,
|
|
url: false,
|
|
},
|
|
alias: {
|
|
process: "process/browser.js",
|
|
},
|
|
extensions: [".ts", ".js"],
|
|
},
|
|
};
|