bsky-app/webpack.config.js

31 lines
909 B
JavaScript

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
}