mirror of
https://github.com/zhigang1992/examples.git
synced 2026-01-12 17:13:21 +08:00
26 lines
775 B
JavaScript
26 lines
775 B
JavaScript
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
|
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
|
|
module.exports = async function(env, argv) {
|
|
const config = await createExpoWebpackConfigAsync(env, argv);
|
|
|
|
// see: https://expo.fyi/webpack-report-property-is-deprecated
|
|
if (env.mode === 'production') {
|
|
config.plugins.push(
|
|
new BundleAnalyzerPlugin({
|
|
path: 'web-report',
|
|
}),
|
|
);
|
|
}
|
|
|
|
config.resolve.alias = {
|
|
...config.resolve.alias,
|
|
// Use Preact aliases
|
|
react$: 'preact/compat',
|
|
'react-dom$': 'preact/compat',
|
|
// Fix the responder system which react-native-web depends on
|
|
'react-dom/unstable-native-dependencies$': 'preact-responder-event-plugin',
|
|
};
|
|
return config;
|
|
};
|