forked from bluesky-social/social-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
30 lines (28 loc) · 909 Bytes
/
webpack.config.js
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
const createExpoWebpackConfigAsync = require('@expo/webpack-config')
const {withAlias} = require('@expo/webpack-config/addons')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
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,
]
if (env.mode === 'development') {
config.plugins.push(new ReactRefreshWebpackPlugin())
}
return config
}