-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
65 lines (61 loc) · 1.9 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* eslint-disable import/no-extraneous-dependencies */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const withPlugins = require('next-compose-plugins');
const withTM = require('next-transpile-modules')(); // pass the modules you would like to see transpiled
// const compose = require('next-compose');
import('next').NextConfig;
const nextConfig = {
//useFileSystemPublicRoutes: false,
output: 'export',
trailingSlash: false,
swcMinify: false,
resolveSymlinks: false,
basePath: '',
poweredByHeader: false,
};
module.exports = withPlugins(
[
[withBundleAnalyzer],
[withTM],
{
poweredByHeader: false,
trailingSlash: true,
swcMinify: true,
basePath: '',
reactStrictMode: true,
// experimental: { esmExternals: true },
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
fs: false,
stream: false,
path: false,
worker_threads: false,
crypto: require.resolve('crypto-browserify'),
os: false,
// below for rainbow kit
tls: false,
net: false,
};
// Use the client static directory in the server bundle and prod mode
// Fixes `Error occurred prerendering page "/"`
// config.output.webassemblyModuleFilename =
// isServer && !dev
// ? '../static/wasm/[modulehash].wasm'
// : 'static/wasm/[modulehash].wasm';
// /https://github.com/ethers-io/ethers.js/issues/998
config.resolve.alias.https = 'https-browserify';
config.resolve.alias.http = 'http-browserify';
config.experiments = {
...config.experiments,
asyncWebAssembly: true,
};
}
return config;
},
},
],
nextConfig,
);