mirror of
https://github.com/luxfhe/example-poker.git
synced 2026-10-30 18:13:22 +00:00
49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
// @ts-check
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
reactStrictMode: true,
|
|
typescript: {
|
|
ignoreBuildErrors: process.env.NEXT_PUBLIC_IGNORE_BUILD_ERROR === "true",
|
|
},
|
|
eslint: {
|
|
ignoreDuringBuilds: process.env.NEXT_PUBLIC_IGNORE_BUILD_ERROR === "true",
|
|
},
|
|
webpack: (config, { isServer }) => {
|
|
config.resolve.fallback = { fs: false, net: false, tls: false };
|
|
config.externals.push("pino-pretty", "lokijs", "encoding");
|
|
|
|
patchWasmModuleImport(config, isServer);
|
|
|
|
// if (!isServer) {
|
|
// config.output.environment = { ...config.output.environment, asyncFunction: true };
|
|
// }
|
|
|
|
return config;
|
|
},
|
|
};
|
|
|
|
function patchWasmModuleImport(config, isServer) {
|
|
config.experiments = Object.assign(config.experiments || {}, {
|
|
asyncWebAssembly: true,
|
|
layers: true,
|
|
topLevelAwait: true,
|
|
});
|
|
|
|
config.optimization.moduleIds = "named";
|
|
|
|
config.module.rules.push({
|
|
test: /\.wasm$/,
|
|
type: "asset/resource",
|
|
});
|
|
|
|
// TODO: improve this function -> track https://github.com/vercel/next.js/issues/25852
|
|
if (isServer) {
|
|
config.output.webassemblyModuleFilename = "./../static/wasm/tfhe_bg.wasm";
|
|
} else {
|
|
config.output.webassemblyModuleFilename = "static/wasm/tfhe_bg.wasm";
|
|
}
|
|
}
|
|
|
|
module.exports = nextConfig;
|