forked from GeekyAnts/NativeBase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
44 lines (42 loc) · 1.19 KB
/
next.config.js
File metadata and controls
44 lines (42 loc) · 1.19 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
/** @type {import('next').NextConfig} */
const { withExpo } = require('@expo/next-adapter');
const withPlugins = require('next-compose-plugins');
const path = require('path');
const withTM = require('next-transpile-modules')(['react-native-web']);
const nextConfig = {
reactStrictMode: true,
experimental: {
externalDir: true,
},
webpack: (config) => {
config.resolve.alias = {
...(config.resolve.alias || {}),
// Transform all direct `react-native` imports to `react-native-web`
'react-native$': path.resolve(
__dirname,
'node_modules',
'react-native-web'
),
'native-base': path.resolve(__dirname, '..', 'src'),
'react': path.resolve(__dirname, 'node_modules', 'react'),
'react-dom': path.resolve(__dirname, 'node_modules', 'react-dom'),
'react-native-web': path.resolve(
__dirname,
'node_modules',
'react-native-web'
),
};
config.resolve.extensions = [
'.web.js',
'.web.jsx',
'.web.ts',
'.web.tsx',
...config.resolve.extensions,
];
return config;
},
};
module.exports = withPlugins(
[withTM, [withExpo, { projectRoot: __dirname }]],
nextConfig
);