about summary refs log tree commit diff
path: root/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 000000000..28e5ca0db
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,26 @@
+const createExpoWebpackConfigAsync = require('@expo/webpack-config')
+const {withAlias} = require('@expo/webpack-config/addons')
+
+const reactNativeWebWebviewConfiguration = {
+  test: /postMock.html$/,
+  use: {
+    loader: 'file-loader',
+    options: {
+      name: '[name].[ext]',
+    },
+  },
+}
+
+module.exports = async function (env, argv) {
+  let config = await createExpoWebpackConfigAsync(env, argv)
+  config = withAlias(config, {
+    'react-native$': 'react-native-web',
+    'react-native-linear-gradient': 'react-native-web-linear-gradient',
+    'react-native-webview': 'react-native-web-webview',
+  })
+  config.module.rules = [
+    ...(config.module.rules || []),
+    reactNativeWebWebviewConfiguration,
+  ]
+  return config
+}