-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
47 lines (44 loc) · 1.2 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
const withTranspileModules = require("next-transpile-modules");
const webConfig = require("./react-native-web.config");
const withTM = withTranspileModules(webConfig.needsTranspile);
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
experimental: {
images: {
unoptimized: true,
},
},
basePath: "/cherag",
assetPrefix: "/cherag",
webpack: (config) => {
config.module.rules.push({
test: /\.(woff|woff2|ttf|eot|svg)$/,
loader: "file-loader",
options: {
esModule: false,
name: "[name].[hash].[ext]",
outputPath:
process.env.NODE_ENV === "production"
? "../../static/fonts"
: "../static/fonts",
publicPath: "/cherag/_next/static/fonts/",
},
});
config.resolve.alias = {
...(config.resolve.alias || {}),
// Transform all direct `react-native` imports to `react-native-web`
"react-native$": "react-native-web",
};
config.resolve.extensions = [
".web.js",
".web.jsx",
".web.ts",
".web.tsx",
...config.resolve.extensions,
];
return config;
},
};
module.exports = withTM(nextConfig);