expo / expo-webpack-integrations

Packages used to integrate Expo in Webpack-based projects.
8 stars 1 forks source link

@expo/webpack-config should be looking in `argv` for `mode`, not `env` #19

Open dancrumb opened 1 year ago

dancrumb commented 1 year ago

Summary

Per the Webpack 5 documentation, https://webpack.js.org/configuration/configuration-types/#exporting-a-function the mode property belongs on the argv object, not the env object.

While Expo itself may incorporate the non-standard approach of putting mode into env other tooling that interprets Webpack configuration files follow the API documentation, resulting in env validation failing.

Environment

N/A

Please specify your device/emulator/simulator platform, model and version

N/A

Error output

Error: @expo/webpack-config requires a validmodestring which should be one of: development, production, none

Reproducible demo or steps to reproduce from a blank project

Just run webpack without the env mode=development