-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.mjs
46 lines (35 loc) · 1.04 KB
/
next.config.mjs
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
import createNextIntlPlugin from 'next-intl/plugin';
import { withPlausibleProxy } from 'next-plausible';
const withNextIntl = createNextIntlPlugin();
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
webpack: (config, { isServer, webpack }) => {
const wasmRegex = /argon2.*\.wasm$/;
config.module.rules.push({
test: wasmRegex,
loader: 'base64-loader',
type: 'javascript/auto',
});
config.module.noParse = wasmRegex;
config.module.rules.forEach(rule => {
(rule.oneOf || []).forEach(oneOf => {
if (oneOf.loader && oneOf.loader.indexOf('file-loader') >= 0) {
oneOf.exclude.push(wasmRegex);
}
});
});
if (!isServer) {
config.resolve.fallback.fs = false;
}
config.plugins.push(
new webpack.IgnorePlugin({ resourceRegExp: /\/__tests__\// })
);
config.experiments = {
asyncWebAssembly: true,
layers: true,
};
return config;
},
};
export default withPlausibleProxy()(withNextIntl(nextConfig));