https://github.com/GeekyAnts/NativeBase
Raw File
Tip revision: 9e5bb251f866d7e83afab4016eb0dd9396696c24 authored by Rohit Singh on 21 March 2022, 13:39:24 UTC
feat: v3.3.x theme object export
Tip revision: 9e5bb25
webpack.config.js
const path = require('path');
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
const { resolver } = require('./metro.config');

const root = path.resolve(__dirname, '..');
const node_modules = path.join(__dirname, 'node_modules');

module.exports = async function(env, argv) {
    const config = await createExpoWebpackConfigAsync(env, argv);

    config.module.rules.push({
        test: /\.(js|ts|tsx)$/,
        include: path.resolve(root, 'src'),
        use: 'babel-loader',
    });

    // We need to make sure that only one version is loaded for peerDependencies
    // So we alias them to the versions in example's node_modules
    Object.assign(config.resolve.alias, {
        ...resolver.extraNodeModules,
        'react-native-web': path.join(node_modules, 'react-native-web'),
    });

    return config;
};
back to top