1- const path = require ( 'path' )
21const createExpoWebpackConfigAsync = require ( '@expo/webpack-config' )
2+ const path = require ( 'path' )
3+
34const { resolver } = require ( './metro.config' )
45
56const root = path . resolve ( __dirname , '..' )
@@ -8,25 +9,41 @@ const node_modules = path.join(__dirname, 'node_modules')
89module . exports = async function ( env , argv ) {
910 const config = await createExpoWebpackConfigAsync ( env , argv )
1011
11- config . module . rules . push ( {
12- test : / \. ( j s | j s x | t s | t s x ) $ / ,
13- include : path . resolve ( root , 'src' ) ,
14- use : 'babel-loader' ,
15- } )
12+ config . entry = path . join ( __dirname , 'index.js' )
13+
14+ config . module . rules . push (
15+ {
16+ test : / \. ( j s | t s | t s x ) $ / ,
17+ include : path . resolve ( root , 'src' ) ,
18+ use : 'babel-loader' ,
19+ } ,
20+ {
21+ test : / \. t t f $ / ,
22+ loader : 'url-loader' , // or directly file-loader
23+ include : path . resolve (
24+ __dirname ,
25+ 'node_modules/@react-native-vector-icons'
26+ ) ,
27+ }
28+ )
29+
30+ config . ignoreWarnings = [
31+ {
32+ module : / O v e r l a y \. j s / ,
33+ } ,
34+ ( ) => true ,
35+ ]
1636
1737 // We need to make sure that only one version is loaded for peerDependencies
1838 // So we alias them to the versions in example's node_modules
1939 Object . assign ( config . resolve . alias , {
2040 ...resolver . extraNodeModules ,
41+ 'crypto' : require . resolve ( 'expo-crypto' ) , //Fixes issue with crypto not being found on web
2142 'react-native-web' : path . join ( node_modules , 'react-native-web' ) ,
43+ '@react-native-vector-icons/material-design-icons' : require . resolve (
44+ '@expo/vector-icons/MaterialCommunityIcons'
45+ ) ,
2246 } )
2347
24- // Add fallback for crypto and stream module
25- config . resolve . fallback = {
26- ...config . resolve . fallback ,
27- crypto : require . resolve ( 'crypto-browserify' ) ,
28- stream : require . resolve ( 'stream-browserify' ) ,
29- }
30-
3148 return config
3249}
0 commit comments