-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
98 lines (91 loc) · 2.68 KB
/
next.config.js
File metadata and controls
98 lines (91 loc) · 2.68 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
const CopyPlugin = require("copy-webpack-plugin");
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ["js", "jsx", "ts", "tsx"],
images: { unoptimized: true },
trailingSlash: true,
async redirects() {
return redirects;
},
webpack: (config, { dev, isServer }) => {
// Enable WebAssembly
config.experiments = {
asyncWebAssembly: true,
layers: true,
topLevelAwait: true,
};
// Handle WASM files
if (isServer) {
config.output.webassemblyModuleFilename = "chunks/[modulehash].wasm";
} else {
config.output.webassemblyModuleFilename = "static/wasm/[modulehash].wasm";
}
// Copy WASM files to the correct location
const destinations = [
"static/wasm/[name][ext]",
"server/static/wasm/[name][ext]",
"server/chunks/[name][ext]",
".next/static/wasm/[name][ext]",
".next/server/static/wasm/[name][ext]",
".next/server/chunks/[name][ext]",
];
config.plugins.push(
new CopyPlugin({
patterns: destinations.map((dest) => ({
from: "node_modules/lumina-node/**/*.wasm",
to: dest,
noErrorOnMissing: true,
})),
})
);
return config;
},
};
const redirects = [
{
source: "/learn/first-principles/modular-blockchains-and-first-principles/",
destination: "/learn/beginners/modular-blockchains-and-first-principles/",
permanent: true,
},
{
source: "/learn/values-of-modular-blockchains/modular-blockchains-are-user-first/",
destination: "/learn/beginners/modular-blockchains-are-user-first/",
permanent: true,
},
{
source: "/learn/basics-of-modular-blockchains/modular-and-monolithic-blockchains/",
destination: "/learn/intermediates/modular-and-monolithic-blockchains/",
permanent: true,
},
{
source: "/learn/basics-of-modular-blockchains/benefits-of-modular-blockchains/",
destination: "/learn/intermediates/benefits-of-modular-blockchains/",
permanent: true,
},
{
source: "/learn/modular-architectures/the-modular-stack/",
destination: "/learn/intermediates/the-modular-stack/",
permanent: true,
},
{
source: "/learn/modular-software/the-differences-of-modular-software/",
destination: "/learn/intermediates/the-differences-of-modular-software/",
permanent: true,
},
{
source: "/learn/sovereign-rollups/an-introduction/",
destination: "/learn/intermediates/sovereign-rollups-an-introduction/",
permanent: true,
},
{
source: "/learn/sovereign-rollups/misconceptions/",
destination: "/learn/intermediates/sovereign-rollups-misconceptions/",
permanent: true,
},
{
source: "/learn/modular-settlement-layers/settlement-in-the-modular-stack/",
destination: "/learn/intermediates/settlement-in-the-modular-stack/",
permanent: true,
},
];
module.exports = nextConfig;