-
-
Notifications
You must be signed in to change notification settings - Fork 947
Expand file tree
/
Copy pathwebpack.config.js
More file actions
40 lines (35 loc) · 1.05 KB
/
webpack.config.js
File metadata and controls
40 lines (35 loc) · 1.05 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
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
const path = require('path');
const root = path.resolve(__dirname, '..');
const node_modules = path.join(__dirname, 'node_modules');
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(
{
...env,
babel: {
dangerouslyAddModulePathsToTranspile: ['react-native-reanimated'],
},
},
argv
);
config.module.rules.push({
test: /\.(js|jsx|ts|tsx)$/,
include: path.resolve(root, 'src'),
use: 'babel-loader',
});
Object.assign(config.resolve.alias, {
react: path.join(node_modules, 'react'),
'react-native': path.join(node_modules, 'react-native'),
'react-native-web': path.join(node_modules, 'react-native-web'),
'react-native-reanimated': path.join(
node_modules,
'react-native-reanimated'
),
'react-native-gesture-handler': path.join(
node_modules,
'react-native-gesture-handler'
),
});
// Customize the config before returning it.
return config;
};