mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
- Replace yarn v1 with pnpm 10.11.0 across all build configs - Move misplaced deps to devDependencies (cspell, esbuild, @openzeppelin/contracts, @next/bundle-analyzer, @types/papaparse, @types/react-scroll) - Remove stale @types/[email protected] override — use correct React 19 types (fixes 22 type errors) - Convert yarn resolutions to pnpm.overrides - Update Dockerfile, Dockerfile.lux, CI workflows, and all shell scripts - Add .npmrc with shamefully-hoist for Next.js compatibility - Add outputFileTracingRoot to next.config.js
59 lines
1.9 KiB
JavaScript
59 lines
1.9 KiB
JavaScript
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
|
enabled: process.env.BUNDLE_ANALYZER === 'true',
|
|
});
|
|
|
|
const withRoutes = require('nextjs-routes/config')({
|
|
outDir: 'nextjs',
|
|
});
|
|
|
|
const headers = require('./nextjs/headers');
|
|
const redirects = require('./nextjs/redirects');
|
|
const rewrites = require('./nextjs/rewrites');
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const moduleExports = {
|
|
transpilePackages: [
|
|
'react-syntax-highlighter',
|
|
],
|
|
reactStrictMode: true,
|
|
webpack(config) {
|
|
config.module.rules.push(
|
|
{
|
|
test: /\.svg$/,
|
|
use: [ '@svgr/webpack' ],
|
|
},
|
|
);
|
|
config.resolve.fallback = { fs: false, net: false, tls: false };
|
|
config.externals.push('pino-pretty', 'lokijs', 'encoding');
|
|
|
|
config.experiments = { ...config.experiments, topLevelAwait: true };
|
|
// Tell webpack the target supports async/await so it stops warning about top-level await
|
|
// Top-level await is belong to ES2017 specification that is adopted by all major browsers and Node.js.
|
|
config.output.environment = {
|
|
...config.output.environment,
|
|
asyncFunction: true,
|
|
};
|
|
|
|
return config;
|
|
},
|
|
// NOTE: all config functions should be static and not depend on any environment variables
|
|
// since all variables will be passed to the app only at runtime and there is now way to change Next.js config at this time
|
|
// if you are stuck and strongly believe what you need some sort of flexibility here please fill free to join the discussion
|
|
// https://github.com/blockscout/frontend/discussions/167
|
|
rewrites,
|
|
redirects,
|
|
headers,
|
|
output: 'standalone',
|
|
outputFileTracingRoot: __dirname,
|
|
productionBrowserSourceMaps: false,
|
|
serverExternalPackages: ["@opentelemetry/sdk-node", "@opentelemetry/auto-instrumentations-node"],
|
|
experimental: {
|
|
staleTimes: {
|
|
dynamic: 30,
|
|
'static': 180,
|
|
},
|
|
},
|
|
};
|
|
|
|
module.exports = withBundleAnalyzer(withRoutes(moduleExports));
|