世博会 React Native Web 构建优化最佳实践

Est*_*net 6 optimization webpack react-native expo

我正在寻找在构建网络时优化 Expo React 本机应用程序的最佳实践。我每次运行时都会expo build:web出现此警告:

Compiled with warnings.

asset size limit: The following asset(s) exceed the recommended size limit (586 KiB).
This can impact web performance.
Assets: 
  static/js/2.e9374ad4.chunk.js (2.2 MiB)

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (586 KiB). This can impact web performance.
Entrypoints:
  app (2.2 MiB)
      static/js/runtime~app.2e9f1821.js
      static/js/2.e9374ad4.chunk.js
      static/js/app.1b833e73.chunk.js

webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
Run Code Online (Sandbox Code Playgroud)

我可以做什么来优化它?

我的webpack.config.js文件如下所示:

const createExpoWebpackConfigAsync = require('@expo/webpack-config');

module.exports = async function (env, argv) {
  const config = await createExpoWebpackConfigAsync(
    { 
      ...env,
      offline: true,
      performance: {
        maxEntrypointSize: 512000,
        maxAssetSize: 512000
      }
    }, 
    argv);
  return config;
};
Run Code Online (Sandbox Code Playgroud)