-
Notifications
You must be signed in to change notification settings - Fork 86
/
next.config.js
97 lines (96 loc) · 2.64 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
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
const withFonts = require('next-fonts');
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
});
const { withExpo } = require('@expo/next-adapter');
const redirectsJSON = require('./redirects.json');
const withPlugins = require('next-compose-plugins');
const withTM = require('next-transpile-modules')([
'native-base',
'react-native-web',
'react-native-svg',
// "react-native-safe-area-context",
// "@react-aria/visually-hidden",
// "@react-native-aria/button",
// "@react-native-aria/checkbox",
// "@react-native-aria/combobox",
// "@react-native-aria/focus",
// "@react-native-aria/interactions",
// "@react-native-aria/listbox",
// "@react-native-aria/overlays",
// "@react-native-aria/radio",
// "@react-native-aria/slider",
// "@react-native-aria/tabs",
// "@react-native-aria/utils",
// "@react-stately/combobox",
// "@react-stately/radio",
]);
module.exports = withPlugins(
[[withTM], [withFonts], [withMDX], [withExpo, { projectRoot: __dirname }]],
{
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
// webpack: (config) => {
// 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.ts",
// ".web.tsx",
// ...config.resolve.extensions,
// ];
// return config;
// },
async redirects() {
return [
{
source: '/discord',
destination: 'https://discord.com/invite/TSgCw2UPmb',
permanent: true,
},
{
source: '/blogs',
destination: 'https://nativebase.io/blogs',
permanent: true,
},
...redirectsJSON,
];
},
images: {
domains: [
'docs.nativebase.io',
'media-exp1.licdn.com',
'mir-s3-cdn-cf.behance.net',
'avatars.githubusercontent.com',
'images.opencollective.com',
'pbs.twimg.com',
],
},
env: {
environment: process.env.ENVIRONMENT,
},
webpack: (config) => {
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.ts',
'.web.tsx',
...config.resolve.extensions,
];
return config;
},
typescript: {
ignoreBuildErrors: true,
},
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
}
);