Can I get a webpack resolve alias working on android with expo?

Viewed 197

I'm trying to get a preact library to work with expo/react-native

It works find on web using this alias in webpack:

// webpack.config.js
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
module.exports = async function(env, argv) {
  const config = await createExpoWebpackConfigAsync(env, argv);
  config.resolve.alias = {
    ...config.resolve.alias,
    'preact': 'react'
  }
  return config;
};

But on android I get an error: Unable to resolve "preact" from "node_modules/.../....

Does anyone know how to get the same kind of alias working outside of web?

0 Answers
Related